From 46fbfe3ff0b2fb78d375195d4353ed561c6f9a36 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 20 Jul 2015 10:50:01 -0700 Subject: [PATCH] wrap: use infimum-by instead of min-by. --- basis/wrap/wrap.factor | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/basis/wrap/wrap.factor b/basis/wrap/wrap.factor index e142a3dcf3..2a8bb01a07 100644 --- a/basis/wrap/wrap.factor +++ b/basis/wrap/wrap.factor @@ -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 ) {