mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
e106812a77
This should make our preferred solution to #6538 easier to implement, avoid a bunch of potential nastiness with excessive int-vs-double math, and generally make the code there a little less scary. "But wait!" you say. "Is it really safe to do this? Won't the results come out differently?" Yes, but not much. We now round every weighted bandwidth to the nearest byte before computing on it. This will make every node that had a fractional part of its weighted bandwidth before either slighty more likely or slightly less likely. Further, the rand_bw value was only ever set with integer precision, so it can't accurately sample routers with tiny fractional bandwidth values anyway. Finally, doing repeated double-vs-uint64 comparisons is just plain sad; it will involve an implicit cast to double, which is never a fun thing. |
||
---|---|---|
.. | ||
bug6043 | ||
bug6218 | ||
bug6252_again | ||
bug6271 | ||
bug6274 | ||
bug6274_2 | ||
bug6296 | ||
bug6377 | ||
bug6387 | ||
bug6397 | ||
bug6436 | ||
bug6480 | ||
bug6490 | ||
bug6500 | ||
bug6530 | ||
bug6538 | ||
cov709056 | ||
pathsel-BUGGY-a | ||
port_doc | ||
revert-geoip-may2012 | ||
smartlist_foreach |