aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2009-09-15 18:00:48 -0700
committerMike Perry <mikeperry-git@fscked.org>2009-09-16 17:20:29 -0700
commit5bd60d8a411c90000e6a55e70eb814ea6c69e011 (patch)
treeb3ba5ffe439d68d33926ec113bc712eab45b5f4c /src/or/circuitbuild.c
parent81dc435ffaa86382c7702a5d7c7460635225dcb7 (diff)
downloadtor-5bd60d8a411c90000e6a55e70eb814ea6c69e011.tar
tor-5bd60d8a411c90000e6a55e70eb814ea6c69e011.tar.gz
Address nickm's issues from his review #1.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index a141795a1..25b81992b 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -88,7 +88,7 @@ static smartlist_t *entry_guards = NULL;
static int entry_guards_dirty = 0;
/** If set, we're running the unit tests: we should avoid clobbering
- * our state file. */
+ * our state file or accessing get_options() or get_or_state() */
static int unit_tests = 0;
/********* END VARIABLES ************/
@@ -427,11 +427,15 @@ circuit_build_times_update_alpha(circuit_build_times_t *cbt)
cbt->Xm = circuit_build_times_mode(cbt);
for (i=0; i< NCIRCUITS_TO_OBSERVE; i++) {
- if (!x[i]) continue;
+ if (!x[i]) {
+ continue;
+ }
- // Hrmm, should we count < Xm as Xm or just drop
- if (x[i] < cbt->Xm) a += ln(cbt->Xm);
- else a += ln(x[i]);
+ if (x[i] < cbt->Xm) {
+ a += ln(cbt->Xm);
+ } else {
+ a += ln(x[i]);
+ }
n++;
}