mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
优化优先队列-Priority值越大,优先级越高
This commit is contained in:
@@ -17,7 +17,7 @@ func (pq PriorityQueueSlice) Len() int { return len(pq) }
|
||||
|
||||
func (pq PriorityQueueSlice) Less(i, j int) bool {
|
||||
// We want Pop to give us the highest, not lowest, Priority so we use greater than here.
|
||||
return pq[i].Priority < pq[j].Priority
|
||||
return pq[i].Priority > pq[j].Priority
|
||||
}
|
||||
|
||||
func (pq PriorityQueueSlice) Swap(i, j int) {
|
||||
|
||||
Reference in New Issue
Block a user