From 190668be5fa9473a6249ef5dee52e3014efb79cc Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 26 Oct 2020 12:58:22 +0800 Subject: [PATCH] 1 --- listhead.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/listhead.go b/listhead.go index b23cc5e..65e6b71 100644 --- a/listhead.go +++ b/listhead.go @@ -19,10 +19,12 @@ func (this *ListHead) Del() { func (this *ListHead) AddTail(pnew *ListHead) { prev := this.prev - prev.next = pnew - this.prev = pnew - pnew.next = this + next := this + + next.prev = pnew + pnew.next = next pnew.prev = prev + prev.next = pnew } func (this *ListHead) FirstEntry() interface{} {