]> gitweb.factorcode.org Git - factor.git/commitdiff
io.ports: bring back file read performance, ignoring zeroes.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 24 Sep 2015 03:07:53 +0000 (20:07 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 24 Sep 2015 03:07:53 +0000 (20:07 -0700)
basis/io/ports/ports.factor

index 208e023e08348ae5f1df529d46769a4aa680d901..77b54d7192edfda039b4865ba8779b542aabb45e 100644 (file)
@@ -208,9 +208,8 @@ M: output-port stream-seek
 M: buffered-port stream-seekable?
     handle>> can-seek-handle? ;
 
-! Cannot be ``handle>> handle-length`` because of a race condition.
 M: buffered-port stream-length
-    drop f ;
+    handle>> handle-length [ f ] when-zero ;
 
 GENERIC: shutdown ( handle -- )