summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAmjad Ben Hedhili <amjadhedhili@outlook.com>2023-03-13 08:43:45 +0100
committerGitHub <noreply@github.com>2023-03-13 08:43:45 +0100
commitc52e44d8459c04387940bc95e90ed36877466fac (patch)
tree84937f782e3f37efd7a03a9b66fd778e631ee99f /lib
parentb2c1dcbbc9b097c9c13dda4951e824cdb5f16225 (diff)
downloadNim-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')
-rw-r--r--lib/pure/collections/lists.nim4
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