12345678910111213141516171819202122232425262728293031323334 |
- $OpenBSD: patch-src_hash_dbr_hash_h,v 1.1 2017/05/19 13:19:59 espie Exp $
- two phase name lookup
- Index: src/hash/dbr_hash.h
- --- src/hash/dbr_hash.h.orig
- +++ src/hash/dbr_hash.h
- @@ -124,7 +124,7 @@ class DBRHash : public DHashBase<KT, struct dbr_hash_s
- inline bool remove(KT key)
- {
- struct dbr_hash_slot<KT> *slot;
- - if (! search(key, &slot))
- + if (! this->search(key, &slot))
- return false;
- slot->key = deletedKey;
- int array_slot = slot->array_slot;
- @@ -134,7 +134,7 @@ class DBRHash : public DHashBase<KT, struct dbr_hash_s
- return true;
- }
- data_array[array_slot] = data_array[--this->count];
- - if (! search(data_array[array_slot], &slot))
- + if (! this->search(data_array[array_slot], &slot))
- {
- log_debug("DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n", data_array[array_slot], array_slot, this->count);
- throw zmm::Exception(_("DBR-Hash-Error: key in data_array not found in hashtable"));
- @@ -146,7 +146,7 @@ class DBRHash : public DHashBase<KT, struct dbr_hash_s
- inline void put(KT key)
- {
- struct dbr_hash_slot<KT> *slot;
- - if (! search(key, &slot))
- + if (! this->search(key, &slot))
- {
- #ifdef TOMBDEBUG
- if (this->count >= realCapacity)
|