]> gitweb.factorcode.org Git - factor.git/commitdiff
io.streams.random: slightly faster.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 May 2013 15:35:03 +0000 (08:35 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 May 2013 15:35:03 +0000 (08:35 -0700)
extra/io/streams/random/random.factor

index dae22b88d93dbd4f388afcefeda2fd3b32009bcd..2c3b0833772946f122305e525bba549b8eba265e 100644 (file)
@@ -11,9 +11,9 @@ C: <random-stream> random-stream
 M: random-stream stream-element-type drop +byte+ ;
 
 M: random-stream stream-read-unsafe
-    drop [ dup random-bytes ] [ 0 swap copy ] bi* ;
+    drop [ dup random-bytes ] [ 0 swap copy-unsafe ] bi* ;
 
-M: random-stream stream-read1 drop 256 random ;
+M: random-stream stream-read1 drop 256 random-integer ;
 
 M: random-stream stream-read-partial-unsafe stream-read-unsafe ;