Explorar o código

add num_entries assertion

Thomas Waldmann %!s(int64=2) %!d(string=hai) anos
pai
achega
316bb7c937
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/borg/_hashindex.c

+ 2 - 0
src/borg/_hashindex.c

@@ -225,6 +225,8 @@ hashindex_resize(HashIndex *index, int capacity)
             return 0;
             return 0;
         }
         }
     }
     }
+    assert(index->num_entries == new->num_entries);
+
     hashindex_free_buckets(index);
     hashindex_free_buckets(index);
     index->buckets = new->buckets;
     index->buckets = new->buckets;
     index->num_buckets = new->num_buckets;
     index->num_buckets = new->num_buckets;