Explorar o código

if we have enough usable guards, just pick one

we don't need to check whether we don't have enough guards right after
concluding that we do have enough.

slight efficiency fix suggested by an anonymous fellow on irc.
Roger Dingledine %!s(int64=14) %!d(string=hai) anos
pai
achega
e98c9a1bf6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/or/circuitbuild.c

+ 1 - 1
src/or/circuitbuild.c

@@ -4186,7 +4186,7 @@ choose_random_entry(cpath_build_state_t *state)
         goto choose_and_finish;
         goto choose_and_finish;
       }
       }
       if (smartlist_len(live_entry_guards) >= options->NumEntryGuards)
       if (smartlist_len(live_entry_guards) >= options->NumEntryGuards)
-        break; /* we have enough */
+        goto choose_and_finish; /* we have enough */
   } SMARTLIST_FOREACH_END(entry);
   } SMARTLIST_FOREACH_END(entry);
 
 
   if (entry_list_is_constrained(options)) {
   if (entry_list_is_constrained(options)) {