浏览代码

hashindex: simplify assert

Thomas Waldmann 2 年之前
父节点
当前提交
83e6b4269e
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/borg/_hashindex.c

+ 2 - 3
src/borg/_hashindex.c

@@ -763,10 +763,9 @@ hashindex_set(HashIndex *index, const unsigned char *key, const void *value)
                 assert(BUCKET_IS_EMPTY(index, start_idx));
                 idx = start_idx;
             }
-        } else if(BUCKET_IS_DELETED(index, idx)) {
-            /* as expected, nothing to do */
         } else {
-            assert(0);  /* bucket is full, must not happen! */
+            /* Bucket must be either EMPTY (see above) or DELETED. */
+            assert(BUCKET_IS_DELETED(index, idx));
         }
         ptr = BUCKET_ADDR(index, idx);
         memcpy(ptr, key, index->key_size);