[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] if we have enough usable guards, just pick one



commit e98c9a1bf6e64a641fd904cbef58b1e46da89e91
Author: Roger Dingledine <arma@xxxxxxxxxxxxxx>
Date:   Tue Sep 27 17:35:31 2011 -0400

    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.
---
 src/or/circuitbuild.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 9029315..08a1f6f 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -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)) {

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits