From c52e44d8459c04387940bc95e90ed36877466fac Mon Sep 17 00:00:00 2001 From: Amjad Ben Hedhili Date: Mon, 13 Mar 2023 08:43:45 +0100 Subject: 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 --- lib/pure/collections/lists.nim | 4 ++-- 1 file 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 -- cgit 1.4.1-2-gfad0