]> gitweb.factorcode.org Git - factor.git/commitdiff
unicode.case: slightly faster >title.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 24 Aug 2012 22:14:48 +0000 (15:14 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 24 Aug 2012 22:16:27 +0000 (15:16 -0700)
basis/unicode/case/case.factor

index e68bf656afce4e0e88d7287b5c113e7d97657b79..d14c765f4cf10a937c70320f7f8118bb72b2ce95 100644 (file)
@@ -107,10 +107,11 @@ HINTS: >upper string ;
 PRIVATE>
 
 : capitalize ( string -- title )
-    unclip 1string [ >lower ] [ (>title) ] bi* prepend ; inline
+    unclip-slice 1string [ >lower ] [ (>title) ] bi*
+    "" prepend-as ; inline
 
 : >title ( string -- title )
-    final-sigma >words [ capitalize ] map concat ;
+    final-sigma >words [ capitalize ] map! concat ;
 
 HINTS: >title string ;