[bugfix] fix OrderedTable iterators (#11562)
This commit is contained in:
parent
79c721d418
commit
3d50f7e2a1
1 changed files with 7 additions and 5 deletions
|
|
@ -1253,11 +1253,13 @@ proc enlarge[A, B](t: var OrderedTable[A, B]) =
|
||||||
h = nxt
|
h = nxt
|
||||||
|
|
||||||
template forAllOrderedPairs(yieldStmt: untyped) {.dirty.} =
|
template forAllOrderedPairs(yieldStmt: untyped) {.dirty.} =
|
||||||
var h = t.first
|
if t.counter > 0:
|
||||||
while h >= 0:
|
var h = t.first
|
||||||
var nxt = t.data[h].next
|
while h >= 0:
|
||||||
if isFilled(t.data[h].hcode): yieldStmt
|
var nxt = t.data[h].next
|
||||||
h = nxt
|
if isFilled(t.data[h].hcode):
|
||||||
|
yieldStmt
|
||||||
|
h = nxt
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue