]> gitweb.factorcode.org Git - factor.git/commitdiff
io.encodings.detect: simplify prolog-tag.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 20 Dec 2014 20:06:54 +0000 (12:06 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 20 Dec 2014 20:06:54 +0000 (12:06 -0800)
extra/io/encodings/detect/detect.factor

index c8b01757f8ddb056f8acc1bd69a81c8707d24eba..c32dac75ec54a7299a51c9787a6d132be6e95bab 100644 (file)
@@ -13,7 +13,7 @@ default-8bit-encoding [ latin1 ] initialize
 <PRIVATE\r
 \r
 : prolog-tag ( bytes -- string )\r
-    CHAR: > over index [ 1 + ] [ dup length ] if* head-slice >string ;\r
+    CHAR: > over index [ 1 + head-slice ] when* >string ;\r
 \r
 : prolog-encoding ( string -- iana-encoding )\r
     '[\r