]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/heaps/heaps.factor
Merge OneEyed's patch
[factor.git] / basis / heaps / heaps.factor
index 564d7db17f73bf30f6c43ec8e7b024eb3b05871a..65cb6541f422a4e84880869959242e95355f3c3e 100644 (file)
@@ -82,8 +82,8 @@ M: heap heap-size ( heap -- n )
     data>> first ; inline
 
 : data-exchange ( m n heap -- )
-    [ tuck data-nth [ data-nth ] dip ] 3keep
-    tuck [ data-set-nth ] 2dip data-set-nth ; inline
+    [ [ data-nth ] curry bi@ ]
+    [ [ data-set-nth ] curry bi@ ] 3bi ; inline
 
 GENERIC: heap-compare ( pair1 pair2 heap -- ? )