[or-cvs] r10724: Don't get private with smartlists when there's a perfectly f (tor/trunk/src/or)

weasel at seul.org weasel at seul.org
Mon Jul 2 19:45:44 UTC 2007


Author: weasel
Date: 2007-07-02 15:45:44 -0400 (Mon, 02 Jul 2007)
New Revision: 10724

Modified:
   tor/trunk/src/or/routerlist.c
Log:
Don't get private with smartlists when there's a perfectly fine accessor method for num_used

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-07-02 19:36:22 UTC (rev 10723)
+++ tor/trunk/src/or/routerlist.c	2007-07-02 19:45:44 UTC (rev 10724)
@@ -1867,7 +1867,7 @@
 static INLINE int
 _routerlist_find_elt(smartlist_t *sl, void *ri, int idx)
 {
-  tor_assert(idx < sl->num_used);
+  tor_assert(idx < smartlist_len(sl));
   if (idx < 0 || smartlist_get(sl, idx) != ri) {
     idx = -1;
     SMARTLIST_FOREACH(sl, routerinfo_t *, r,
@@ -2422,7 +2422,7 @@
                          router->cache_info.identity_digest);
   if (old_router) {
     int pos = old_router->routerlist_index;
-    tor_assert(0 <= pos && pos < routerlist->routers->num_used);
+    tor_assert(0 <= pos && pos < smartlist_len(routerlist->routers));
     tor_assert(smartlist_get(routerlist->routers, pos) == old_router);
 
     if (router->cache_info.published_on <=



More information about the tor-commits mailing list