From 0495ff055551edab76d700c6e591ef573e4d1540 Mon Sep 17 00:00:00 2001 From: Laurent Egbakou <26142591+egbakou@users.noreply.github.com> Date: Sun, 24 Nov 2024 03:20:13 +0100 Subject: [PATCH] refactor(structure:linkedlist): renamed variable in singlylinkedlist.go --- structure/linkedlist/singlylinkedlist.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/structure/linkedlist/singlylinkedlist.go b/structure/linkedlist/singlylinkedlist.go index 9f951737f..57b09b104 100644 --- a/structure/linkedlist/singlylinkedlist.go +++ b/structure/linkedlist/singlylinkedlist.go @@ -125,14 +125,14 @@ func (ll *Singly[T]) Count() int { // Reverse reverses the list. func (ll *Singly[T]) Reverse() { - var prev, Next *Node[T] + var prev, next *Node[T] cur := ll.Head for cur != nil { - Next = cur.Next + next = cur.Next cur.Next = prev prev = cur - cur = Next + cur = next } ll.Head = prev