]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Replace entry_guard_get_by_id_digest_for_guard_selection impl.
authorNick Mathewson <nickm@torproject.org>
Tue, 14 Feb 2017 15:28:54 +0000 (10:28 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Feb 2017 15:28:54 +0000 (10:28 -0500)
We already implemented this whole function somewhere else; no need
to have the same code twice.

src/or/entrynodes.c

index 3bb51693554f4a7a34cc1eb338551648926c1f12..93dd2bd59cc43ead354066f59103b05c0c0346b3 100644 (file)
@@ -2901,13 +2901,7 @@ entry_guard_t *
 entry_guard_get_by_id_digest_for_guard_selection(guard_selection_t *gs,
                                                  const char *digest)
 {
-  tor_assert(gs != NULL);
-
-  SMARTLIST_FOREACH(gs->sampled_entry_guards, entry_guard_t *, entry,
-                    if (tor_memeq(digest, entry->identity, DIGEST_LEN))
-                      return entry;
-                   );
-  return NULL;
+  return get_sampled_guard_with_id(gs, (const uint8_t*)digest);
 }
 
 /** Return the node_t associated with a single entry_guard_t. May