summaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-03 00:58:54 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-03 00:58:54 +0000
commitfc4d15baf6d3833015feeceb0c9374304bb9900c (patch)
tree21bff329b403fd81e2df0264c9d4f7b96d8781c9 /src/or/onion.c
parentbbc94849576878955b58e1297e43d2b83db576cb (diff)
downloadtor-fc4d15baf6d3833015feeceb0c9374304bb9900c.tar.gz
tor-fc4d15baf6d3833015feeceb0c9374304bb9900c.zip
Hide smartlist internals
svn:r1451
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 44e32c44fb..0ed13b8135 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -405,12 +405,10 @@ static void remove_twins_from_smartlist(smartlist_t *sl, routerinfo_t *twin) {
if(twin == NULL)
return;
-/* XXX abstraction violation: this function reaches inside smartlist :( */
- for(i=0; i < sl->num_used; i++) {
- r = sl->list[i];
+ for(i=0; i < smartlist_len(sl); i++) {
+ r = smartlist_get(sl,i);
if (!crypto_pk_cmp_keys(r->onion_pkey, twin->onion_pkey)) {
- sl->list[i] = sl->list[--sl->num_used]; /* swap with the end */
- i--; /* so we process the new i'th element */
+ smartlist_del(sl,i--);
}
}
}