fib: implicitly delete empty Entry
Fib::removeNextHopFromAllEntries automatically deletes fib::Entry
if the last nexthop record is being removed.
refs #1341
Change-Id: I36d42fe8f9fc8f03d194f845020aff408cd70488
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
index 5d11c27..430ed3c 100644
--- a/daemon/table/name-tree.cpp
+++ b/daemon/table/name-tree.cpp
@@ -498,8 +498,10 @@
}
// process other buckets
- int newLocation = m_entry->m_hash % m_nameTree.m_nBuckets + 1;
- for (newLocation = newLocation; newLocation < m_nameTree.m_nBuckets; newLocation++)
+
+ for (int newLocation = m_entry->m_hash % m_nameTree.m_nBuckets + 1;
+ newLocation < static_cast<int>(m_nameTree.m_nBuckets);
+ ++newLocation)
{
// process each bucket
name_tree::Node* node = m_nameTree.m_buckets[newLocation];
@@ -637,6 +639,9 @@
m_entry = m_nameTree.m_end;
return *this;
}
+
+ BOOST_ASSERT(false); // unknown type
+ return *this;
}
} // namespace nfd