[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Make smartlist_foreach always use the fast versions.



Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv27459/src/common

Modified Files:
	container.h 
Log Message:
Make smartlist_foreach always use the fast versions.

Index: container.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/container.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- container.h	18 Oct 2005 05:03:44 -0000	1.19
+++ container.h	18 Oct 2005 17:38:07 -0000	1.20
@@ -100,11 +100,11 @@
  */
 #define SMARTLIST_FOREACH(sl, type, var, cmd)                   \
   do {                                                          \
-    int var ## _sl_idx, var ## _sl_len=smartlist_len(sl);       \
+    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
     type var;                                                   \
     for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
          ++var ## _sl_idx) {                                    \
-      var = smartlist_get((sl),var ## _sl_idx);                 \
+      var = (sl)->list[var ## _sl_idx];                         \
       cmd;                                                      \
     } } while (0)