Skip to content

Commit ffe4195

Browse files
committed
Fix Swap function for lfu.priorityQueue.
1 parent 0cefe16 commit ffe4195

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

policy/lfu/priotiry_queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (l priorityQueue[K, V]) Less(i, j int) bool {
5252
func (l priorityQueue[K, V]) Swap(i, j int) {
5353
l[i], l[j] = l[j], l[i]
5454
l[i].index = i
55-
l[i].index = j
55+
l[j].index = j
5656
}
5757

5858
func (l *priorityQueue[K, V]) Push(x interface{}) {

0 commit comments

Comments
 (0)