From 68b662c44ce8444baba29b40eceef73e80f27f1d Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sat, 13 Dec 2014 16:01:20 -0800 Subject: [PATCH] heaps: make data-first throw on empty. --- basis/heaps/heaps.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/heaps/heaps.factor b/basis/heaps/heaps.factor index 2706b10f36..27b53860ff 100644 --- a/basis/heaps/heaps.factor +++ b/basis/heaps/heaps.factor @@ -62,7 +62,7 @@ M: heap heap-size ( heap -- n ) data>> nth-unsafe { entry } declare ; inline : data-first ( heap -- entry ) - 0 swap data-nth ; inline + data>> first ; inline : data-set-nth ( entry n heap -- ) [ [ >>index ] keep ] dip data>> set-nth-unsafe ; inline