summaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-10-18 04:51:07 +0000
committerNick Mathewson <nickm@torproject.org>2005-10-18 04:51:07 +0000
commit768160c872da938d14b441fceef25de1d473df58 (patch)
tree4c8f725c4aa4876f75907220130690b3d001b376 /src/common/container.c
parent27fcbf87f3a11a033fdfb1e5e2a7f415b7125bdc (diff)
downloadtor-768160c872da938d14b441fceef25de1d473df58.tar.gz
tor-768160c872da938d14b441fceef25de1d473df58.zip
Inline key smartlist functions; use fast versions by default.
svn:r5265
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/common/container.c b/src/common/container.c
index e681a5df18..838b5f818c 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -28,19 +28,6 @@ const char container_c_id[] = "$Id$";
*/
#define SMARTLIST_DEFAULT_CAPACITY 32
-#ifndef FAST_SMARTLIST
-/** A resizeable list of pointers, with associated helpful functionality. */
-struct smartlist_t {
- /* <b>list</b> has enough capacity to store exactly <b>capacity</b> elements
- * before it needs to be resized. Only the first <b>num_used</b> (\<=
- * capacity) elements point to valid data.
- */
- void **list;
- int num_used;
- int capacity;
-};
-#endif
-
/** Allocate and return an empty smartlist.
*/
smartlist_t *
@@ -236,36 +223,6 @@ smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2)
smartlist_remove(sl1, sl2->list[i]);
}
-#ifndef FAST_SMARTLIST
-/** Return the <b>idx</b>th element of sl.
- */
-void *
-smartlist_get(const smartlist_t *sl, int idx)
-{
- tor_assert(sl);
- tor_assert(idx>=0);
- tor_assert(idx < sl->num_used);
- return sl->list[idx];
-}
-/** Change the value of the <b>idx</b>th element of sl to <b>val</b>.
- */
-void
-smartlist_set(smartlist_t *sl, int idx, void *val)
-{
- tor_assert(sl);
- tor_assert(idx>=0);
- tor_assert(idx < sl->num_used);
- sl->list[idx] = val;
-}
-/** Return the number of items in sl.
- */
-int
-smartlist_len(const smartlist_t *sl)
-{
- return sl->num_used;
-}
-#endif
-
/** Remove the <b>idx</b>th element of sl; if idx is not the last
* element, swap the last element of sl into the <b>idx</b>th space.
* Return the old value of the <b>idx</b>th element.