Renamed variables for consistency
This commit is contained in:
1 parent
c63b163703
commit
840c0b9f86
10 files changed
+135
-134
No files matched your search
@@ -141,12 +141,12 @@ func (c *MDNSClient) checkInFlightQueries() time.Duration {
|
||||
after := MaxDuration
|
||||
for name, query := range c.inflight {
|
||||
// Invariant on responseInfos: they are in non-descending order of timeout.
|
||||
num_closed := 0
|
||||
numClosed := 0
|
||||
for _, item := range query.responseInfos {
|
||||
duration := item.timeout.Sub(now)
|
||||
if duration <= 0 { // timed out
|
||||
close(item.ch)
|
||||
num_closed++
|
||||
numClosed++
|
||||
} else {
|
||||
if duration < after {
|
||||
after = duration
|
||||
@@ -155,7 +155,7 @@ func (c *MDNSClient) checkInFlightQueries() time.Duration {
|
||||
}
|
||||
}
|
||||
// Remove timed-out items from the slice
|
||||
query.responseInfos = query.responseInfos[num_closed:]
|
||||
query.responseInfos = query.responseInfos[numClosed:]
|
||||
if len(query.responseInfos) == 0 {
|
||||
delete(c.inflight, name)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user