From 70f167375b56dd6e45fdc8b4333123d6b3aed9e0 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Mon, 29 Aug 2016 08:10:13 -0400 Subject: [PATCH] Fix pheap when count > total elements --- src/recon.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recon.erl b/src/recon.erl index 2a3f83e..227597e 100644 --- a/src/recon.erl +++ b/src/recon.erl @@ -707,7 +707,7 @@ sublist_top_n(List, Len) -> pheap_fill(List, 0, Heap) -> pheap_full(List, Heap); -pheap_fill([], 0, Heap) -> +pheap_fill([], _, Heap) -> pheap_to_list(Heap, []); pheap_fill([{Y, X, _} = H|T], N, Heap) -> pheap_fill(T, N-1, insert({{X, Y}, H}, Heap)).