[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
|
||||
|
||||
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
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue