table: don't use shared_ptr in FIB
refs #3164
Change-Id: I5b5eb47d60f6bf5b6389c32ac840f793767e4334
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index ef68175..df6ca4d 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -59,19 +59,19 @@
bool wantUnused = false,
time::steady_clock::TimePoint now = time::steady_clock::TimePoint::min())
{
- shared_ptr<Face> upstream = nexthop.getFace();
+ Face& upstream = nexthop.getFace();
// upstream is current downstream
- if (upstream->getId() == currentDownstream)
+ if (upstream.getId() == currentDownstream)
return false;
// forwarding would violate scope
- if (violatesScope(*pitEntry, *upstream))
+ if (violatesScope(*pitEntry, upstream))
return false;
if (wantUnused) {
// NextHop must not have unexpired out-record
- pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(*upstream);
+ pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(upstream);
if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
return false;
}
@@ -93,7 +93,7 @@
for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
if (!predicate_NextHop_eligible(pitEntry, *it, currentDownstream))
continue;
- pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(*it->getFace());
+ pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(it->getFace());
BOOST_ASSERT(outRecord != pitEntry->out_end());
if (outRecord->getLastRenewed() < earliestRenewed) {
found = it;
@@ -136,10 +136,10 @@
return;
}
- shared_ptr<Face> outFace = it->getFace();
+ Face& outFace = it->getFace();
this->sendInterest(pitEntry, outFace);
NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
- << " newPitEntry-to=" << outFace->getId());
+ << " newPitEntry-to=" << outFace.getId());
return;
}
@@ -148,10 +148,10 @@
bind(&predicate_NextHop_eligible, pitEntry, _1, inFace.getId(),
true, time::steady_clock::now()));
if (it != nexthops.end()) {
- shared_ptr<Face> outFace = it->getFace();
+ Face& outFace = it->getFace();
this->sendInterest(pitEntry, outFace);
NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
- << " retransmit-unused-to=" << outFace->getId());
+ << " retransmit-unused-to=" << outFace.getId());
return;
}
@@ -161,10 +161,10 @@
NFD_LOG_DEBUG(interest << " from=" << inFace.getId() << " retransmitNoNextHop");
}
else {
- shared_ptr<Face> outFace = it->getFace();
+ Face& outFace = it->getFace();
this->sendInterest(pitEntry, outFace);
NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
- << " retransmit-retry-to=" << outFace->getId());
+ << " retransmit-retry-to=" << outFace.getId());
}
}