parent
82275e3779
commit
f89218c8b0
1 changed files with 2 additions and 2 deletions
|
|
@ -188,11 +188,11 @@ iterator leaves*(r: Rope): string =
|
||||||
var stack = @[r]
|
var stack = @[r]
|
||||||
while stack.len > 0:
|
while stack.len > 0:
|
||||||
var it = stack.pop
|
var it = stack.pop
|
||||||
while isNil(it.data):
|
while it.left != nil:
|
||||||
|
assert it.right != nil
|
||||||
stack.add(it.right)
|
stack.add(it.right)
|
||||||
it = it.left
|
it = it.left
|
||||||
assert(it != nil)
|
assert(it != nil)
|
||||||
assert(it.data != nil)
|
|
||||||
yield it.data
|
yield it.data
|
||||||
|
|
||||||
iterator items*(r: Rope): char =
|
iterator items*(r: Rope): char =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue