]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
if we have enough usable guards, just pick one
authorRoger Dingledine <arma@torproject.org>
Tue, 27 Sep 2011 21:35:31 +0000 (17:35 -0400)
committerRoger Dingledine <arma@torproject.org>
Tue, 27 Sep 2011 21:35:31 +0000 (17:35 -0400)
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.

src/or/circuitbuild.c

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