aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-07 11:52:13 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-07 11:52:13 -0400
commit64c8e8edda5a7f3525a1ab365c4bd72b19212322 (patch)
treef332a7c68897a39b81976bc9b0392e5e81848013 /src/or/connection_edge.c
parent174cbff8cf855dc1bbf690694f539ba3f85a508c (diff)
downloadtor-64c8e8edda5a7f3525a1ab365c4bd72b19212322.tar.gz
tor-64c8e8edda5a7f3525a1ab365c4bd72b19212322.zip
Kill redundant checks around routerset_contains_*()
All of the routerset_contains*() functions return 0 if their routerset_t argument is NULL. Therefore, there's no point in doing "if (ExcludeNodes && routerset_contains*(ExcludeNodes...))", for example. This patch fixes every instance of if (X && routerstatus_contains*(X,...)) Note that there are other patterns that _aren't_ redundant. For example, we *don't* want to change: if (EntryNodes && !routerstatus_contains(EntryNodes,...)) Fixes #2797. No bug here; just needless code.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index c490148485..3f6e87cb20 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -3146,8 +3146,7 @@ connection_ap_can_use_exit(edge_connection_t *conn, const node_t *exit)
if (!conn->chosen_exit_name && node_exit_policy_rejects_all(exit))
return 0;
}
- if (options->_ExcludeExitNodesUnion &&
- routerset_contains_node(options->_ExcludeExitNodesUnion, exit)) {
+ if (routerset_contains_node(options->_ExcludeExitNodesUnion, exit)) {
/* Not a suitable exit. Refuse it. */
return 0;
}