diff options
author | Robert Ransom <rransom.8774@gmail.com> | 2011-10-15 14:22:56 -0700 |
---|---|---|
committer | Robert Ransom <rransom.8774@gmail.com> | 2011-10-30 02:17:07 -0700 |
commit | ae9a831294bd9bc6129b447ea3e7e24ab210794c (patch) | |
tree | 7565344becd422cf088dbb70d3b0e72eb1c0580c /src/or/rendservice.c | |
parent | e46d56a9b4458370cb8de0c92e10688402749845 (diff) | |
download | tor-ae9a831294bd9bc6129b447ea3e7e24ab210794c.tar.gz tor-ae9a831294bd9bc6129b447ea3e7e24ab210794c.zip |
Use SMARTLIST_FOREACH_BEGIN and _END, not a for loop
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index e89d689357..30f5df706f 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1940,8 +1940,7 @@ rend_services_introduce(void) /* Find out which introduction points we have in progress for this service. */ - for (j=0; j < smartlist_len(service->intro_nodes); ++j) { - intro = smartlist_get(service->intro_nodes, j); + SMARTLIST_FOREACH_BEGIN(service->intro_nodes, rend_intro_point_t *, intro){ router = router_get_by_digest(intro->extend_info->identity_digest); if (!router || !find_intro_circuit(intro, service->pk_digest)) { log_info(LD_REND,"Giving up on %s as intro point for %s.", @@ -1954,12 +1953,12 @@ rend_services_introduce(void) service->desc_is_dirty = now; } rend_intro_point_free(intro); - smartlist_del(service->intro_nodes,j--); + SMARTLIST_DEL_CURRENT(service->intro_nodes, intro); intro_point_set_changed = 1; } if (router) smartlist_add(intro_routers, router); - } + } SMARTLIST_FOREACH_END(intro); if (!intro_point_set_changed && (smartlist_len(service->intro_nodes) >= |