mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
[bugfix] fix OrderedTable iterators (#11562)
(cherry picked from commit 3d50f7e2a1)
This commit is contained in:
@@ -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
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user