Merge pull request #10539 from GULPF/strtabs-nexttry

Change strtabs.nextTry to match the assumption in strtabs.del
This commit is contained in:
LemonBoy 2019-02-03 11:49:41 +01:00 • committed by GitHub
commit 1adc749ed6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,7 @@ proc mustRehash(length, counter: int): bool =
result = (length * 2 < counter * 3) or (length - counter < 4) result = (length * 2 < counter * 3) or (length - counter < 4)
proc nextTry(h, maxHash: Hash): Hash {.inline.} = proc nextTry(h, maxHash: Hash): Hash {.inline.} =
result = ((5 * h) + 1) and maxHash result = (h + 1) and maxHash
proc rawGet(t: StringTableRef, key: string): int = proc rawGet(t: StringTableRef, key: string): int =
var h: Hash = myhash(t, key) and high(t.data) # start with real hash value var h: Hash = myhash(t, key) and high(t.data) # start with real hash value