]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
simplify we_use_microdescriptors_for_circuits()
authorRoger Dingledine <arma@torproject.org>
Sun, 2 Oct 2016 06:22:03 +0000 (02:22 -0400)
committerRoger Dingledine <arma@torproject.org>
Sun, 2 Oct 2016 06:22:03 +0000 (02:22 -0400)
src/or/microdesc.c

index ccb28a914d0e1b60a6a08c808cae907cb2670448..140117f683901b5dbfb918b3da23e2ef50a13862 100644 (file)
@@ -917,12 +917,9 @@ update_microdescs_from_networkstatus(time_t now)
 int
 we_use_microdescriptors_for_circuits(const or_options_t *options)
 {
-  int ret = options->UseMicrodescriptors;
-  if (ret == -1) {
-    /* UseMicrodescriptors is "auto"; choose yes. */
-    return 1;
-  }
-  return ret;
+  if (options->UseMicrodescriptors == 0)
+    return 0; /* the user explicitly picked no */
+  return 1; /* yes and auto both mean yes */
 }
 
 /** Return true iff we should try to download microdescriptors at all. */