improved swap (#974)

This commit is contained in:
田欧 2017-07-05 09:55:50 +08:00 committed by Bo-Yi Wu
parent 735748b359
commit 7d043cedb1
1 changed files with 1 additions and 3 deletions

View File

@ -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--
}