[bugfix] fix OrderedTable iterators (#11562)

This commit is contained in:
Miran
2019-06-23 07:28:45 +02:00
committed by Varriount
parent 79c721d418
commit 3d50f7e2a1

View File

@@ -1253,11 +1253,13 @@ proc enlarge[A, B](t: var OrderedTable[A, B]) =
h = nxt
template forAllOrderedPairs(yieldStmt: untyped) {.dirty.} =
var h = t.first
while h >= 0:
var nxt = t.data[h].next
if isFilled(t.data[h].hcode): yieldStmt
h = nxt
if t.counter > 0:
var h = t.first
while h >= 0:
var nxt = t.data[h].next
if isFilled(t.data[h].hcode):
yieldStmt
h = nxt
# ----------------------------------------------------------------------