patch-src_hash_dbr_hash_h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. $OpenBSD: patch-src_hash_dbr_hash_h,v 1.1 2017/05/19 13:19:59 espie Exp $
  2. two phase name lookup
  3. Index: src/hash/dbr_hash.h
  4. --- src/hash/dbr_hash.h.orig
  5. +++ src/hash/dbr_hash.h
  6. @@ -124,7 +124,7 @@ class DBRHash : public DHashBase<KT, struct dbr_hash_s
  7. inline bool remove(KT key)
  8. {
  9. struct dbr_hash_slot<KT> *slot;
  10. - if (! search(key, &slot))
  11. + if (! this->search(key, &slot))
  12. return false;
  13. slot->key = deletedKey;
  14. int array_slot = slot->array_slot;
  15. @@ -134,7 +134,7 @@ class DBRHash : public DHashBase<KT, struct dbr_hash_s
  16. return true;
  17. }
  18. data_array[array_slot] = data_array[--this->count];
  19. - if (! search(data_array[array_slot], &slot))
  20. + if (! this->search(data_array[array_slot], &slot))
  21. {
  22. log_debug("DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n", data_array[array_slot], array_slot, this->count);
  23. throw zmm::Exception(_("DBR-Hash-Error: key in data_array not found in hashtable"));
  24. @@ -146,7 +146,7 @@ class DBRHash : public DHashBase<KT, struct dbr_hash_s
  25. inline void put(KT key)
  26. {
  27. struct dbr_hash_slot<KT> *slot;
  28. - if (! search(key, &slot))
  29. + if (! this->search(key, &slot))
  30. {
  31. #ifdef TOMBDEBUG
  32. if (this->count >= realCapacity)