summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ropes.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ropes.nim b/compiler/ropes.nim
index 89b92b76d..05d5e840c 100644
--- a/compiler/ropes.nim
+++ b/compiler/ropes.nim
@@ -188,11 +188,11 @@ iterator leaves*(r: Rope): string =
     var stack = @[r]
     while stack.len > 0:
       var it = stack.pop
-      while isNil(it.data):
+      while it.left != nil:
+        assert it.right != nil
         stack.add(it.right)
         it = it.left
         assert(it != nil)
-      assert(it.data != nil)
       yield it.data
 
 iterator items*(r: Rope): char =