]> gitweb.factorcode.org Git - factor.git/commitdiff
random: use nths-unsafe in sample.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 6 Apr 2013 21:20:42 +0000 (14:20 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 6 Apr 2013 21:29:47 +0000 (14:29 -0700)
basis/random/random.factor

index d2dae4335bf7a93875272aaf673474fd6cd379ec..230aec2f73c245630539010f2c67f5e46684224d 100644 (file)
@@ -116,7 +116,7 @@ ERROR: too-many-samples seq n ;
 : sample ( seq n -- seq' )
     2dup [ length ] dip < [ too-many-samples ] when
     [ [ length iota >array ] dip [ randomize-n-last ] keep tail-slice* ]
-    [ drop ] 2bi nths ;
+    [ drop ] 2bi nths-unsafe ;
 
 : delete-random ( seq -- elt )
     [ length random-integer ] keep