[bugfix] fix OrderedTable default initialization (#11549)
This commit is contained in:
parent
55da84e141
commit
45bbf1ef5b
2 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue