Skip to content
Permalink
Browse files
Fix pheap when count > total elements
  • Loading branch information
ferd committed Aug 29, 2016
1 parent a02d7df commit 70f167375b56dd6e45fdc8b4333123d6b3aed9e0
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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)).

0 comments on commit 70f1673

Please sign in to comment.