]> gitweb.factorcode.org Git - factor.git/commitdiff
simple-flat-file: faster drop-comments.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Feb 2017 00:03:01 +0000 (16:03 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Feb 2017 00:03:01 +0000 (16:03 -0800)
basis/simple-flat-file/simple-flat-file.factor

index 17057c926757826975efb76781949b604e40ff02..f39bce1288b2ff09616b278867aa8d605a0541d9 100644 (file)
@@ -6,7 +6,7 @@ splitting ;
 IN: simple-flat-file
 
 : drop-comments ( seq -- newseq )
-    [ "#@" split first ] map harvest ;
+    [ dup [ "#@" member? ] find drop [ head ] when* ] map harvest ;
 
 : split-column ( line -- columns )
     " \t" split harvest 2 short head 2 f pad-tail ;