]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/heaps/heaps.factor
basis: use lint.vocabs tool to trim using lists
[factor.git] / basis / heaps / heaps.factor
index 3d35a5fb928917b0ff7e064618e233acd992a1eb..2c6d4c8102b06ebf247a540cdfb92b7d2ba6a31d 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2007, 2008 Ryan Murphy, Doug Coleman,
 ! Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs combinators fry kernel
-kernel.private locals math math.order math.private sequences
-sequences.private summary vectors ;
+USING: accessors arrays assocs fry kernel kernel.private
+math math.order math.private sequences sequences.private summary
+vectors ;
 IN: heaps
 
 GENERIC: heap-push* ( value key heap -- entry )
@@ -35,11 +35,9 @@ TUPLE: max-heap < heap ;
 
 : <max-heap> ( -- max-heap ) max-heap <heap> ;
 
-M: heap heap-empty? ( heap -- ? )
-    data>> empty? ; inline
+M: heap heap-empty? data>> empty? ; inline
 
-M: heap heap-size ( heap -- n )
-    data>> length ; inline
+M: heap heap-size data>> length ; inline
 
 <PRIVATE
 
@@ -75,7 +73,7 @@ PRIVATE>
 : >entry< ( entry -- value key )
     [ value>> ] [ key>> ] bi ; inline
 
-M: heap heap-peek ( heap -- value key )
+M: heap heap-peek
     data>> first >entry< ;
 
 <PRIVATE
@@ -117,7 +115,7 @@ M: heap heap-push*
 ! A quote from cpython's implementation:
 ! > We *could* break out of the loop as soon as we find a pos where newitem <=
 ! > both its children, but turns out that's not a good idea [...]
-! Indeed the code is 33% slower if we remove this optmization.
+! Indeed the code is 33% slower if we remove this optimization.
 :: sift-up ( heap n -- )
     heap data>>     :> data
     data length     :> end