[bugfix] fix OrderedTable default initialization (#11549)

This commit is contained in:
Miran 2019-06-20 21:03:11 +02:00 • committed by Andreas Rumpf
commit 45bbf1ef5b
2 changed files with 3 additions and 2 deletions

View file

@ -118,6 +118,9 @@ template initImpl(result: typed, size: int) =
assert isPowerOfTwo(size)
result.counter = 0
newSeq(result.data, size)
when compiles(result.first):
result.first = -1
result.last = -1
template insertImpl() = # for CountTable
if t.dataLen == 0: initImpl(t, defaultInitialSize)