aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-02-08 20:27:58 +0000
committerRoger Dingledine <arma@torproject.org>2007-02-08 20:27:58 +0000
commit90b53beec5ba4ea19f144c17a5bbe7936e0c49c5 (patch)
tree44991011e15b9077109f634153d5a80dab9a7fcf /src/or
parenta1a9c66ce52756370336dcb6f5dd8329566d3792 (diff)
downloadtor-90b53beec5ba4ea19f144c17a5bbe7936e0c49c5.tar
tor-90b53beec5ba4ea19f144c17a5bbe7936e0c49c5.tar.gz
add a comment so i stop worrying
svn:r9532
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerlist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 58dc80985..541cbc76d 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1008,6 +1008,8 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, int for_exit, int statuses)
if (n_unknown) {
int32_t avg_fast, avg_slow;
if (total_exit_bw+total_nonexit_bw) {
+ /* if there's some bandwidth, there's at least one known router,
+ * so no worries about div by 0 here */
avg_fast = avg_slow =
(total_exit_bw+total_nonexit_bw)/(smartlist_len(sl)-n_unknown);
} else {