diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-09-15 04:27:58 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-09-15 04:27:58 +0000 |
commit | e58b9c1151c0591a95ebb97e21db315698e0bb27 (patch) | |
tree | d6ff16e0cdc481cd271d22c6a364cde9634a71f4 /src/or/router.c | |
parent | ce83f4362934bbe87341a88d55ff0a1e80014cd5 (diff) | |
download | tor-e58b9c1151c0591a95ebb97e21db315698e0bb27.tar tor-e58b9c1151c0591a95ebb97e21db315698e0bb27.tar.gz |
r8819@Kushana: nickm | 2006-09-15 00:27:45 -0400
Implement a smartlist_uniq() that will with luck not end the world.
svn:r8396
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/or/router.c b/src/or/router.c index 24c827836..032069c48 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -804,7 +804,6 @@ router_rebuild_descriptor(int force) if (authdir_mode(options)) ri->is_valid = ri->is_named = 1; /* believe in yourself */ if (options->MyFamily) { - int i; smartlist_t *family; if (!warned_nonexistent_family) warned_nonexistent_family = smartlist_create(); @@ -844,15 +843,7 @@ router_rebuild_descriptor(int force) /* remove duplicates from the list */ smartlist_sort_strings(ri->declared_family); - for (i = 1; i < smartlist_len(ri->declared_family); ++i) { - const char *a, *b; - a = smartlist_get(ri->declared_family, i-1); - b = smartlist_get(ri->declared_family, i); - if (!strcmp(a,b)) { - tor_free(smartlist_get(ri->declared_family, i)); - smartlist_del_keeporder(ri->declared_family, i--); - } - } + smartlist_uniq_strings(ri->declared_family); smartlist_free(family); } |