mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes #25173
(cherry picked from commit 51a9ada043)
This commit is contained in:
@@ -708,6 +708,8 @@ proc remove*[T](L: var SinglyLinkedList[T], n: SinglyLinkedNode[T]): bool {.disc
|
||||
L.head = n.next
|
||||
if L.tail.next == n:
|
||||
L.tail.next = L.head # restore cycle
|
||||
if L.tail == n:
|
||||
L.tail = nil # reset tail if we removed the last node
|
||||
else:
|
||||
var prev {.cursor.} = L.head
|
||||
while prev.next != n and prev.next != nil:
|
||||
|
||||
Reference in New Issue
Block a user