]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
simplify compare_cached_resolves_by_expiry() to make it match
authorRoger Dingledine <arma@torproject.org>
Mon, 14 Aug 2006 07:08:29 +0000 (07:08 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 14 Aug 2006 07:08:29 +0000 (07:08 +0000)
the idioms of other compare functions. hopefully i didn't
break it?

svn:r7048

src/or/connection_edge.c
src/or/dns.c

index dac0a5c8934f0708de2bd2cfde0dd6a03afaa241..0131b066b926965fababffa22316a89a0427181b 100644 (file)
@@ -321,7 +321,7 @@ connection_edge_finished_connecting(edge_connection_t *edge_conn)
  * application connections. Rather than waiting a fixed amount of
  * time between each retry, we wait only 5 seconds for the first,
  * 10 seconds for the second, and 15 seconds for each retry after
- * that. Hopefully this will improve the expected experience. */
+ * that. Hopefully this will improve the expected user experience. */
 static int
 compute_socks_timeout(edge_connection_t *conn)
 {
index 54b784f7d77086d77a0c5d74f14add890e1e4ba0..c5ef7befe3b53a8f15868b5c92601e4be8ad4049 100644 (file)
@@ -208,12 +208,7 @@ static int
 _compare_cached_resolves_by_expiry(const void *_a, const void *_b)
 {
   const cached_resolve_t *a = _a, *b = _b;
-  if (a->expire < b->expire)
-    return -1;
-  else if (a->expire == b->expire)
-    return 0;
-  else
-    return 1;
+  return a->expire - b->expire;
 }
 
 /** Priority queue of cached_resolve_t objects to let us know when they