From 7d043cedb1ba33756ae9b69fa554a3062bff70d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E6=AC=A7?= Date: Wed, 5 Jul 2017 09:55:50 +0800 Subject: [PATCH] improved swap (#974) --- tree.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tree.go b/tree.go index a39f43bf..55eab99e 100644 --- a/tree.go +++ b/tree.go @@ -105,9 +105,7 @@ func (n *node) incrementChildPrio(pos int) int { newPos := pos for newPos > 0 && n.children[newPos-1].priority < prio { // swap node positions - tmpN := n.children[newPos-1] - n.children[newPos-1] = n.children[newPos] - n.children[newPos] = tmpN + n.children[newPos-1], n.children[newPos] = n.children[newPos], n.children[newPos-1] newPos-- }