]> gitweb.factorcode.org Git - factor.git/commitdiff
wrap: use infimum-by instead of min-by.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 20 Jul 2015 17:50:01 +0000 (10:50 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 20 Jul 2015 19:25:49 +0000 (12:25 -0700)
basis/wrap/wrap.factor

index e142a3dcf358665aad049b81dc6e193f526dd18a..2a8bb01a07a5640e0cc48e9a04a32446b3b6c321 100644 (file)
@@ -24,12 +24,6 @@ TYPED: fits? ( paragraph: paragraph -- ? )
     ! Make this not count spaces at end
     { [ lines>> car 1list? ] [ top-fits? ] } 1|| ; inline
 
-:: min-by ( seq quot -- elt )
-    f 1/0. seq [| key value newkey |
-        newkey quot call :> newvalue
-        newvalue value < [ newkey newvalue ] [ key value ] if
-    ] each drop ; inline
-
 TYPED: paragraph-cost ( paragraph: paragraph -- cost )
     dup lines>> 1list? [ drop 0 ] [
         [ [ head-width>> ] [ line-ideal>> ] bi - sq ]
@@ -37,7 +31,7 @@ TYPED: paragraph-cost ( paragraph: paragraph -- cost )
     ] if ; inline
 
 : min-cost ( paragraphs -- paragraph )
-    [ paragraph-cost ] min-by ; inline
+    [ paragraph-cost ] infimum-by ; inline
 
 TYPED: new-line ( paragraph: paragraph element: element -- paragraph )
     {