From c6ee627e1bb565c98a651d02844f7ca7a04618d7 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 15 Dec 2014 13:29:01 -0800 Subject: [PATCH] heaps: correctly size the data vector for >min-heap and >max-heap. --- basis/heaps/heaps.factor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/basis/heaps/heaps.factor b/basis/heaps/heaps.factor index 87e7176ba8..b92bfe3668 100644 --- a/basis/heaps/heaps.factor +++ b/basis/heaps/heaps.factor @@ -180,7 +180,9 @@ M: heap heap-delete ] if ; : >min-heap ( assoc -- min-heap ) - [ heap-push-all ] keep ; + dup assoc-size min-heap boa + [ heap-push-all ] keep ; : >max-heap ( assoc -- max-heap ) - [ heap-push-all ] keep ; + dup assoc-size max-heap boa + [ heap-push-all ] keep ;