]> gitweb.factorcode.org Git - factor.git/commitdiff
remove most of the overhead in cmwc, it's fast now
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 16 Oct 2009 21:08:59 +0000 (16:08 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 16 Oct 2009 21:08:59 +0000 (16:08 -0500)
extra/random/cmwc/cmwc.factor

index e9c93c80dbb9ece8897113de34c0b08215343388..1be58d489fec6b08ea391fdcde1fb18ee027636f 100644 (file)
@@ -41,9 +41,9 @@ M:: cmwc random-32* ( cmwc -- n )
     [ [ i>> ] [ Q>> ] bi nth-unsafe * ]
     [ c>> + ] tri
 
-    [ -32 shift cmwc (>>c) ]
-
+    [ >fixnum -32 shift cmwc (>>c) ]
     [ cmwc [ b>> bitand ] [ c>> + ] bi 32 bits ] bi
+
     dup cmwc r>> > [
         cmwc [ 1 + ] change-c drop
         cmwc b>> - 32 bits