table: optimize removal of PIT in-records
Most call sites already have an iterator that can be used directly,
so change deleteInRecord() to accept an iterator instead of doing
another list lookup.
Change-Id: Ie097f4bc4b13e7428e0580ed7cf4dcb506a009f7
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 906c2f2..4aa78e2 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -377,8 +377,7 @@
pitEntry->deleteOutRecord(ingress.face);
}
- // foreach pending downstream
- for (const auto& pendingDownstream : pendingDownstreams) {
+ for (Face* pendingDownstream : pendingDownstreams) {
if (pendingDownstream->getId() == ingress.face.getId() &&
pendingDownstream->getLinkType() != ndn::nfd::LINK_TYPE_AD_HOC) {
continue;
@@ -520,7 +519,7 @@
nackPkt.setHeader(nack);
// erase in-record
- pitEntry->deleteInRecord(egress);
+ pitEntry->deleteInRecord(inRecord);
// send Nack on face
egress.sendNack(nackPkt);