From fd800e130cc7c82cd603c8bfe0a21e33a7e13638 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Mon, 27 Feb 2017 12:43:31 -0600 Subject: [PATCH] heap sort order backwards --- cache.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cache.go b/cache.go index 86cab6b5a..8eab72368 100644 --- a/cache.go +++ b/cache.go @@ -243,6 +243,8 @@ type PairHeap struct { Pairs } +func (p PairHeap) Less(i, j int) bool { return p.Pairs[i].Count < p.Pairs[j].Count } + func (h *Pairs) Push(x interface{}) { // Push and Pop use pointer receivers because they modify the slice's length, // not just its contents.