diff --git a/src/container/heap/heap.go b/src/container/heap/heap.go index 7110c513f0..af05261c10 100644 --- a/src/container/heap/heap.go +++ b/src/container/heap/heap.go @@ -107,7 +107,7 @@ func down(h Interface, i0, n int) bool { break } j := j1 // left child - if j2 := j1 + 1; j2 < n && !h.Less(j1, j2) { + if j2 := j1 + 1; j2 < n && h.Less(j2, j1) { j = j2 // = 2*i + 2 // right child } if !h.Less(j, i) {