mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-05 13:34:46 +00:00
fix rope index (#16100)
* fix rope index
* add testcase
(cherry picked from commit ab2c082cb3)
This commit is contained in:
@@ -204,8 +204,8 @@ proc `[]`*(r: Rope, i: int): char {.rtl, extern: "nroCharAt".} =
|
||||
if x.left.length > j:
|
||||
x = x.left
|
||||
else:
|
||||
dec(j, x.left.length)
|
||||
x = x.right
|
||||
dec(j, x.len)
|
||||
|
||||
iterator leaves*(r: Rope): string =
|
||||
## iterates over any leaf string in the rope `r`.
|
||||
|
||||
Reference in New Issue
Block a user