diff options
author | David Fifield <david@bamsoftware.com> | 2013-10-26 14:34:48 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-10-29 01:05:57 -0400 |
commit | e6e6c245c8ef3e5f854d82a67550456857f57ed4 (patch) | |
tree | 222b9a2a9f61a34bc0a9ce87a45d68c6a2fd0437 /src/or/entrynodes.c | |
parent | 6f33dffec1bfb7c33979477688189c63c1bfb538 (diff) | |
download | tor-e6e6c245c8ef3e5f854d82a67550456857f57ed4.tar.gz tor-e6e6c245c8ef3e5f854d82a67550456857f57ed4.zip |
Simplify transport_is_needed.
By Roger at
https://trac.torproject.org/projects/tor/ticket/5018#comment:11.
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r-- | src/or/entrynodes.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index beb855de90..ca3ef530ea 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1766,22 +1766,16 @@ bridge_resolve_conflicts(const tor_addr_t *addr, uint16_t port, int transport_is_needed(const char *transport_name) { - int retval; - smartlist_t *needed_transports = NULL; - if (!bridge_list) return 0; - needed_transports = smartlist_new(); - SMARTLIST_FOREACH_BEGIN(bridge_list, const bridge_info_t *, bridge) { - if (bridge->transport_name) - smartlist_add(needed_transports, bridge->transport_name); + if (bridge->transport_name && + !strcmp(bridge->transport_name, transport_name)) + return 1; } SMARTLIST_FOREACH_END(bridge); - retval = smartlist_string_isin(needed_transports, transport_name); - smartlist_free(needed_transports); - return retval; + return 0; } /** Remember a new bridge at <b>addr</b>:<b>port</b>. If <b>digest</b> |