1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Refactor HSS::nextTimeout for efficiency

Avoid function call in macro expansion. Reduce number of struct timeval
assignments.
This commit is contained in:
dmiller
2024-06-26 21:54:29 +00:00
parent ba249b2d65
commit eb21ac9ea0
2 changed files with 19 additions and 27 deletions

View File

@@ -391,10 +391,10 @@ public:
true. */
bool sendOK(struct timeval *when) const;
/* If there are pending probe timeouts, fills in when with the time of
the earliest one and returns true. Otherwise returns false and
puts now in when. */
bool nextTimeout(struct timeval *when) const;
/* If there are pending probe timeouts, compares the earliest one with `when`;
if it is earlier than `when`, replaces `when` with the time of
the earliest one and returns true. Otherwise returns false. */
bool soonerTimeout(struct timeval *when) const;
UltraScanInfo *USI; /* The USI which contains this HSS */
/* Removes a probe from probes_outstanding, adjusts HSS and USS