Skip to content

Commit dd8eb66

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents b66711f + 483718d commit dd8eb66

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

heap.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ func (x *Heap[T]) down(parentIndex, n int) bool {
174174

175175
// 交换两个下标位置的元素
176176
func (x *Heap[T]) swap(i, j int) {
177-
t := x.heapSlice[i]
178-
x.heapSlice[i] = x.heapSlice[j]
179-
x.heapSlice[j] = t
177+
x.heapSlice[i], x.heapSlice[j] = x.heapSlice[j], x.heapSlice[i]
180178
}
181179

182180
// ------------------------------------------------ ---------------------------------------------------------------------

0 commit comments

Comments
 (0)