diff --git a/internal/store/store.go b/internal/store/store.go index 53f1840..5aaf884 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -261,11 +261,11 @@ const DefaultScanLimit = 100000 type resultHeap []Result -func (h resultHeap) Len() int { return len(h) } -func (h resultHeap) Less(i, j int) bool { return h[i].Seq < h[j].Seq } -func (h resultHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] } -func (h *resultHeap) Push(x any) { *h = append(*h, x.(Result)) } -func (h *resultHeap) Pop() any { old := *h; n := len(old); x := old[n-1]; *h = old[:n-1]; return x } +func (h resultHeap) Len() int { return len(h) } +func (h resultHeap) Less(i, j int) bool { return h[i].Seq < h[j].Seq } +func (h resultHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] } +func (h *resultHeap) Push(x any) { *h = append(*h, x.(Result)) } +func (h *resultHeap) Pop() any { old := *h; n := len(old); x := old[n-1]; *h = old[:n-1]; return x } func (s *Store) Scan(apex string, limit int) ([]Result, error) { if limit <= 0 {