mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
stop looping once we know what the answer will be
suggested during code review by dgoulet
This commit is contained in:
parent
1f72653544
commit
aa6341d4b9
@ -1347,8 +1347,10 @@ networkstatus_consensus_is_already_downloading(const char *resource)
|
|||||||
connection_t *base = TO_CONN(dirconn);
|
connection_t *base = TO_CONN(dirconn);
|
||||||
if (base->linked_conn &&
|
if (base->linked_conn &&
|
||||||
base->linked_conn->type == CONN_TYPE_AP &&
|
base->linked_conn->type == CONN_TYPE_AP &&
|
||||||
!AP_CONN_STATE_IS_UNATTACHED(base->linked_conn->state))
|
!AP_CONN_STATE_IS_UNATTACHED(base->linked_conn->state)) {
|
||||||
answer = 1;
|
answer = 1;
|
||||||
|
break; /* stop looping, because we know the answer will be yes */
|
||||||
|
}
|
||||||
} SMARTLIST_FOREACH_END(dirconn);
|
} SMARTLIST_FOREACH_END(dirconn);
|
||||||
smartlist_free(fetching_conns);
|
smartlist_free(fetching_conns);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user