fib: merged redundant functions

Change-Id: Iebec912fa7a3b8ab2cfe36835868dbdb068d7076
refs: #4105
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 592b2bd..7e19100 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -78,18 +78,6 @@
 void
 Fib::update(const ndn::Name& name, NexthopList& allHops)
 {
-  FibEntry* entry = processUpdate(name, allHops);
-  if (entry != nullptr && !entry->getRefreshEventId()) {
-    scheduleEntryRefresh(*entry,
-                         [this] (FibEntry& fibEntry) {
-                           this->scheduleLoop(fibEntry);
-                         });
-  }
-}
-
-FibEntry*
-Fib::processUpdate(const ndn::Name& name, NexthopList& allHops)
-{
   _LOG_DEBUG("Fib::update called");
 
   // Get the max possible faces which is the minumum of the configuration setting and
@@ -117,7 +105,7 @@
 
     m_table.emplace(name, entry);
 
-    return &m_table.find(name)->second;
+    entryIt = m_table.find(name);
   }
   // Existing FIB entry that may or may not have nextHops
   else {
@@ -127,7 +115,7 @@
     // Remove empty FIB entry
     if (hopsToAdd.getSize() == 0) {
       remove(name);
-      return nullptr;
+      return;
     }
 
     FibEntry& entry = (entryIt->second);
@@ -151,7 +139,14 @@
     // Increment sequence number
     entry.setSeqNo(entry.getSeqNo() + 1);
 
-    return &(m_table.find(name)->second);
+    entryIt = m_table.find(name);
+
+  }
+  if (entryIt != m_table.end() && !entryIt->second.getRefreshEventId()) {
+    scheduleEntryRefresh(entryIt->second,
+                         [this] (FibEntry& entry) {
+                           scheduleLoop(entry);
+                         });
   }
 }