diff options
author | Amjad Ben Hedhili <amjadhedhili@outlook.com> | 2023-03-13 08:43:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 08:43:45 +0100 |
commit | c52e44d8459c04387940bc95e90ed36877466fac (patch) | |
tree | 84937f782e3f37efd7a03a9b66fd778e631ee99f /lib/pure/collections/lists.nim | |
parent | b2c1dcbbc9b097c9c13dda4951e824cdb5f16225 (diff) | |
download | Nim-c52e44d8459c04387940bc95e90ed36877466fac.tar.gz |
Add `cursor` annotations to lists iterator variables (#21507)
Add `cursor` annotations to iterator variables * See https://nim-lang.github.io/Nim/destructors.html#the-cursor-pragma
Diffstat (limited to 'lib/pure/collections/lists.nim')
-rw-r--r-- | lib/pure/collections/lists.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/collections/lists.nim b/lib/pure/collections/lists.nim index a08c62964..6e3ddf397 100644 --- a/lib/pure/collections/lists.nim +++ b/lib/pure/collections/lists.nim @@ -188,13 +188,13 @@ func toDoublyLinkedList*[T](elems: openArray[T]): DoublyLinkedList[T] {.since: ( result.add(elem) template itemsListImpl() {.dirty.} = - var it = L.head + var it {.cursor.} = L.head while it != nil: yield it.value it = it.next template itemsRingImpl() {.dirty.} = - var it = L.head + var it {.cursor.} = L.head if it != nil: while true: yield it.value |