From 90b53beec5ba4ea19f144c17a5bbe7936e0c49c5 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Thu, 8 Feb 2007 20:27:58 +0000 Subject: [PATCH] add a comment so i stop worrying svn:r9532 --- src/or/routerlist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 58dc80985c..541cbc76dc 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 {