1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-19 14:02:55 +00:00

implement ht idx wrap around less strangely, add comment

This commit is contained in:
Thomas Waldmann 2023-02-08 16:13:30 +01:00
parent 907da00931
commit 4f8c4aea19
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -185,8 +185,8 @@ hashindex_lookup(HashIndex *index, const unsigned char *key, int *start_idx)
return idx;
}
idx++;
if (idx >= index->num_buckets) {
idx -= index->num_buckets;
if (idx >= index->num_buckets) { /* triggers at == already */
idx = 0;
}
if(idx == start) {
/* We have done a full pass over all buckets.