田欧 пре 8 година
родитељ
комит
7d043cedb1
1 измењених фајлова са 1 додато и 3 уклоњено
  1. 1 3
      tree.go

+ 1 - 3
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--
 	}