Workaround for #5098
This commit is contained in:
parent
d6ab21eed5
commit
4423da465a
1 changed files with 3 additions and 4 deletions
|
|
@ -116,16 +116,15 @@ template hasKeyOrPutImpl(enlarge) {.dirty.} =
|
||||||
maybeRehashPutImpl(enlarge)
|
maybeRehashPutImpl(enlarge)
|
||||||
else: result = true
|
else: result = true
|
||||||
|
|
||||||
proc default[T](t: typedesc[T]): T {.inline.} = discard
|
template default[T](t: typedesc[T]): T =
|
||||||
|
var v: T
|
||||||
|
v
|
||||||
|
|
||||||
template delImpl() {.dirty.} =
|
template delImpl() {.dirty.} =
|
||||||
var hc: Hash
|
var hc: Hash
|
||||||
var i = rawGet(t, key, hc)
|
var i = rawGet(t, key, hc)
|
||||||
let msk = maxHash(t)
|
let msk = maxHash(t)
|
||||||
if i >= 0:
|
if i >= 0:
|
||||||
t.data[i].hcode = 0
|
|
||||||
t.data[i].key = default(type(t.data[i].key))
|
|
||||||
t.data[i].val = default(type(t.data[i].val))
|
|
||||||
dec(t.counter)
|
dec(t.counter)
|
||||||
block outer:
|
block outer:
|
||||||
while true: # KnuthV3 Algo6.4R adapted for i=i+1 instead of i=i-1
|
while true: # KnuthV3 Algo6.4R adapted for i=i+1 instead of i=i-1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue