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/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index 32785b8..99f5d36 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -119,7 +119,10 @@
sendNack(const lp::NackHeader& header, Face& egress, const shared_ptr<pit::Entry>& pitEntry) override
{
sendNackHistory.push_back({pitEntry->getInterest(), egress.getId(), header});
- pitEntry->deleteInRecord(egress);
+ auto it = pitEntry->getInRecord(egress);
+ if (it != pitEntry->in_end()) {
+ pitEntry->deleteInRecord(it);
+ }
afterAction();
return true;
}