From 35939b11751cd3492e2775b218990943c2127ab7 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 26 Feb 2024 18:29:11 +0000 Subject: [PATCH] Minor optimization for probe list iteration --- scan_engine.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index ca3249b3a..34c284cec 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -629,7 +629,7 @@ bool HostScanStats::sendOK(struct timeval *when) const { puts now in when. */ bool HostScanStats::nextTimeout(struct timeval *when) const { struct timeval earliest_to = USI->now; - std::list::const_iterator probeI; + std::list::const_iterator probeI, endI; bool pending_probes = false; assert(when); @@ -637,8 +637,8 @@ bool HostScanStats::nextTimeout(struct timeval *when) const { /* For any given invocation, the probe timeout is the same for all probes, so * we can get the earliest-sent probe and then add the timeout to that. */ - for (probeI = probes_outstanding.begin(); probeI != probes_outstanding.end(); - probeI++) { + for (probeI = probes_outstanding.begin(), endI = probes_outstanding.end(); + probeI != endI; probeI++) { UltraProbe *probe = *probeI; if (!probe->timedout) { pending_probes = true;