]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
For integers, if !(E<G), then we can infer that E>=G.
authorNick Mathewson <nickm@torproject.org>
Thu, 25 Feb 2010 22:00:14 +0000 (17:00 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 25 Feb 2010 22:00:14 +0000 (17:00 -0500)
This means that "if (E<G) {abc} else if (E>=G) {def}" can be replaced with
"if (E<G) {abc} else {def}"

Doing the second test explicitly made my mingw gcc nervous that we might
never be initializing casename.

src/or/dirvote.c

index 505af38cfca6b48f27957560ddacf358daacdc59..706e6e44805ceef863f4ef489b80843050dde5ff 100644 (file)
@@ -842,7 +842,7 @@ networkstatus_compute_bw_weights_v9(smartlist_t *chunks, int64_t G, int64_t M,
         casename = "Case 2a (E scarce)";
         Wed = weight_scale;
         Wgd = 0;
-      } else if (E >= G) {
+      } else { /* E >= G */
         casename = "Case 2a (G scarce)";
         Wed = 0;
         Wgd = weight_scale;