--- parser3/src/include/pa_hash.h 2003/03/20 09:41:45 1.58.2.18.2.3 +++ parser3/src/include/pa_hash.h 2003/03/20 13:09:53 1.58.2.18.2.4 @@ -17,7 +17,7 @@ #ifndef PA_HASH_H #define PA_HASH_H -static const char* IDENT_HASH_H="$Date: 2003/03/20 09:41:45 $"; +static const char* IDENT_HASH_H="$Date: 2003/03/20 13:09:53 $"; #include "pa_memory.h" #include "pa_types.h" @@ -63,10 +63,6 @@ public: pair=next; } } - ~Hash() { - destroy_pairs(); - delete refs; - } /// put a [value] under the [key] @returns existed or not bool put(K key, V value) { @@ -259,7 +255,7 @@ private: // allocated bigger refs array allocated=allocates[allocates_index]; threshold=allocated*THRESHOLD_PERCENT/100; - refs=new(0) Pair*[allocated]; + refs=new(UseGC) Pair*[allocated]; // rehash Pair **old_ref=old_refs; @@ -275,19 +271,7 @@ private: pair=next; } - delete old_refs; - } - - void destroy_pairs() { - Pair **ref=refs; - for(int index=0; indexlink; - delete pair; - pair=next; - } - } + delete[] old_refs; } private: //disabled