table: NameTree findExactMatch, findLongestPrefixMatch return Entry*
refs #3687
Change-Id: I32752fd711b9641228fbb7f356e72144780cf9ec
diff --git a/daemon/table/measurements.cpp b/daemon/table/measurements.cpp
index d93cc91..922c9cd 100644
--- a/daemon/table/measurements.cpp
+++ b/daemon/table/measurements.cpp
@@ -101,14 +101,13 @@
template<typename K>
Entry*
-Measurements::findLongestPrefixMatchImpl(const K& key,
- const EntryPredicate& pred) const
+Measurements::findLongestPrefixMatchImpl(const K& key, const EntryPredicate& pred) const
{
- shared_ptr<name_tree::Entry> match = m_nameTree.findLongestPrefixMatch(key,
- [&pred] (const name_tree::Entry& nte) -> bool {
- Entry* entry = nte.getMeasurementsEntry();
- return entry != nullptr && pred(*entry);
- });
+ name_tree::Entry* match = m_nameTree.findLongestPrefixMatch(key,
+ [&pred] (const name_tree::Entry& nte) {
+ const Entry* entry = nte.getMeasurementsEntry();
+ return entry != nullptr && pred(*entry);
+ });
if (match != nullptr) {
return match->getMeasurementsEntry();
}
@@ -116,19 +115,17 @@
}
Entry*
-Measurements::findLongestPrefixMatch(const Name& name,
- const EntryPredicate& pred) const
+Measurements::findLongestPrefixMatch(const Name& name, const EntryPredicate& pred) const
{
return this->findLongestPrefixMatchImpl(name, pred);
}
Entry*
-Measurements::findLongestPrefixMatch(const pit::Entry& pitEntry,
- const EntryPredicate& pred) const
+Measurements::findLongestPrefixMatch(const pit::Entry& pitEntry, const EntryPredicate& pred) const
{
shared_ptr<name_tree::Entry> nte = m_nameTree.lookup(pitEntry);
BOOST_ASSERT(nte != nullptr);
- return this->findLongestPrefixMatchImpl(nte, pred);
+ return this->findLongestPrefixMatchImpl(*nte, pred);
}
Entry*