]> git.ipfire.org Git - thirdparty/tor.git/commit
Refactor smartlist_choose_node_by_bandwidth to be less horrible.
authorNick Mathewson <nickm@torproject.org>
Thu, 9 Aug 2012 16:59:04 +0000 (12:59 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 9 Aug 2012 16:59:04 +0000 (12:59 -0400)
commit9bfb274abb9f9e5d445a75f0b67b433be823a730
tree4a334ce6e4786c6e9b1ab42f9217a56f906f4cbb
parent50aecc68ca33f53f7de086990d5b1856c4d40ab8
Refactor smartlist_choose_node_by_bandwidth to be less horrible.

With this patch, I dump the old kludge of using magic negative
numbers to indicate unknown bandwidths.  I also compute each node's
weighted bandwidth exactly once, rather than computing it once in
a loop to compute the total weighted bandwidth and a second time in
a loop to find which one we picked.
src/or/routerlist.c