table: NameTree::lookup return Entry& instead of shared_ptr
refs #3687
Change-Id: Ie86057337dd36ff2bc6ef3ea0c73fd4ffc4b13d0
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index 06dab3e..6c378dc 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -68,8 +68,7 @@
// ensure NameTree entry exists
name_tree::Entry* nte = nullptr;
if (allowInsert) {
- nte = m_nameTree.lookup(nteName).get();
- BOOST_ASSERT(nte != nullptr);
+ nte = &m_nameTree.lookup(nteName);
}
else {
nte = m_nameTree.findExactMatch(nteName);
@@ -132,12 +131,12 @@
void
Pit::erase(shared_ptr<pit::Entry> entry, bool canDeleteNte)
{
- shared_ptr<name_tree::Entry> nte = m_nameTree.getEntry(*entry);
+ name_tree::Entry* nte = m_nameTree.getEntry(*entry);
BOOST_ASSERT(nte != nullptr);
nte->erasePitEntry(entry);
if (canDeleteNte) {
- m_nameTree.eraseIfEmpty(nte.get());
+ m_nameTree.eraseIfEmpty(nte);
}
--m_nItems;
}