From ecf5ad43edd82b9546c971c1b48f1e116c94372b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 8 Feb 2023 15:05:18 +0100 Subject: [PATCH] hashindex: simplify assert --- src/borg/_hashindex.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/borg/_hashindex.c b/src/borg/_hashindex.c index 0f2b0c5b1..71180a595 100644 --- a/src/borg/_hashindex.c +++ b/src/borg/_hashindex.c @@ -594,10 +594,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);