From 25719527e9d418d2e608825b6d7d5af8337c9c16 Mon Sep 17 00:00:00 2001 From: unK Date: Thu, 25 Sep 2008 20:15:24 +0200 Subject: remove asserts from str_pool --- src/str_pool.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/str_pool.c') diff --git a/src/str_pool.c b/src/str_pool.c index 8da306e7..0906df9f 100644 --- a/src/str_pool.c +++ b/src/str_pool.c @@ -18,7 +18,7 @@ #include "str_pool.h" -#include +//#include #include #include #include @@ -38,7 +38,7 @@ calc_hash(const char *p) { unsigned hash = 5381; - assert(p != NULL); + //assert(p != NULL); while (*p != 0) hash = (hash << 5) + hash + *p++; @@ -72,7 +72,7 @@ char *str_pool_get(const char *value) slot_p = &slots[calc_hash(value) % NUM_SLOTS]; for (slot = *slot_p; slot != NULL; slot = slot->next) { if (strcmp(value, slot->value) == 0 && slot->ref < 0xff) { - assert(slot->ref > 0); + //assert(slot->ref > 0); ++slot->ref; return slot->value; } @@ -87,7 +87,7 @@ char *str_pool_dup(const char *value) { struct slot *slot = value_to_slot(value); - assert(slot->ref > 0); + //assert(slot->ref > 0); if (slot->ref < 0xff) { ++slot->ref; @@ -108,7 +108,7 @@ void str_pool_put(const char *value) struct slot **slot_p, *slot; slot = value_to_slot(value); - assert(slot->ref > 0); + //assert(slot->ref > 0); --slot->ref; if (slot->ref > 0) @@ -117,7 +117,7 @@ void str_pool_put(const char *value) for (slot_p = &slots[calc_hash(value) % NUM_SLOTS]; *slot_p != slot; slot_p = &(*slot_p)->next) { - assert(*slot_p != NULL); + //assert(*slot_p != NULL); } *slot_p = slot->next; -- cgit v1.2.3