]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Hash: dropped relics of hash iterators
authorMaria Matejka <mq@ucw.cz>
Tue, 4 Jun 2024 10:22:14 +0000 (12:22 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 4 Jun 2024 20:20:18 +0000 (22:20 +0200)
lib/hash.h

index 1c744af0fcc6eb6fe29e0ff1aecef8af19147e9d..008689665e4ff758ab6f8d81cafad64b56a1c39d 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef _BIRD_HASH_H_
 #define _BIRD_HASH_H_
 
-#define HASH(type)             struct { type **data; uint count; u16 iterators; u8 order; u8 down_requested:1; }
+#define HASH(type)             struct { type **data; uint count; u8 order; }
 #define HASH_TYPE(v)           typeof(** (v).data)
 #define HASH_SIZE(v)           (1U << (v).order)
 
 
 #define HASH_MAY_STEP_DOWN_(v,pool,rehash_fn,args)                     \
   ({                                                                    \
-    if ((v).iterators)                                                 \
-      (v).down_requested = 1;                                          \
-    else if (((v).count < (HASH_SIZE(v) REHASH_LO_MARK(args))) &&      \
-            ((v).order > (REHASH_LO_BOUND(args))))                     \
+    if (((v).count < (HASH_SIZE(v) REHASH_LO_MARK(args))) &&           \
+       ((v).order > (REHASH_LO_BOUND(args))))                          \
       rehash_fn(&(v), pool, -(REHASH_LO_STEP(args)));                  \
   })
 
 #define HASH_MAY_RESIZE_DOWN_(v,pool,rehash_fn,args)                   \
   ({                                                                    \
-    if ((v).iterators)                                                 \
-      (v).down_requested = 1;                                          \
-    else {                                                             \
+    {                                                                  \
       uint _o = (v).order;                                             \
       while (((v).count < ((1U << _o) REHASH_LO_MARK(args))) &&                \
             (_o > (REHASH_LO_BOUND(args))))                            \