Shortcut probe search for earliest since they are in order by send time.

This commit is contained in:
dmiller 2024-02-29 20:18:12 +00:00
parent 63f82dded0
commit b862961cdb

View file

@ -598,6 +598,9 @@ bool HostScanStats::sendOK(struct timeval *when) const {
if (TIMEVAL_BEFORE(probe_to, earliest_to)) {
earliest_to = probe_to;
}
// probes_outstanding is in order by time sent, so
// the first one we find is the earliest.
break;
}
}
@ -646,6 +649,9 @@ bool HostScanStats::nextTimeout(struct timeval *when) const {
if (TIMEVAL_BEFORE(probe->sent, earliest_to)) {
earliest_to = probe->sent;
}
// probes_outstanding is in order by time sent, so
// the first one we find is the earliest.
break;
}
}
if (pending_probes) {