Reduce usage of std::bind()
C++14 lambdas are easier to read, easier to debug,
and can usually be better optimized by the compiler.
Change-Id: I294f275904f91942a8de946fe63e77078a7608a6
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 9cfb3be..8762e24 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -291,13 +291,13 @@
return fibEntry;
}
- const DelegationList& fh = interest.getForwardingHint();
+ const auto& fh = interest.getForwardingHint();
// Forwarding hint should have been stripped by incoming Interest pipeline when reaching producer region
BOOST_ASSERT(!m_forwarder.getNetworkRegionTable().isInProducerRegion(fh));
const fib::Entry* fibEntry = nullptr;
- for (const Delegation& del : fh) {
- fibEntry = &fib.findLongestPrefixMatch(del.name);
+ for (const auto& delegation : fh) {
+ fibEntry = &fib.findLongestPrefixMatch(delegation.name);
if (fibEntry->hasNextHops()) {
if (fibEntry->getPrefix().size() == 0) {
// in consumer region, return the default route
@@ -305,7 +305,7 @@
}
else {
// in default-free zone, use the first delegation that finds a FIB entry
- NFD_LOG_TRACE("lookupFib delegation=" << del.name << " found=" << fibEntry->getPrefix());
+ NFD_LOG_TRACE("lookupFib delegation=" << delegation.name << " found=" << fibEntry->getPrefix());
}
return *fibEntry;
}