diff options
author | Paul Phillips <paulp@improving.org> | 2009-08-25 14:55:08 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-08-25 14:55:08 +0000 |
commit | f53ec2dc9fbcd07a9e298f1c72a7baffda9a671a (patch) | |
tree | affa3491e84a169d0a3303e100b11fa816c78a11 /src/library | |
parent | 8aed300faa06fbae28f4108be6c9ef2a4b9902ef (diff) | |
download | scala-f53ec2dc9fbcd07a9e298f1c72a7baffda9a671a.tar.gz scala-f53ec2dc9fbcd07a9e298f1c72a7baffda9a671a.tar.bz2 scala-f53ec2dc9fbcd07a9e298f1c72a7baffda9a671a.zip |
Small tweak to nextString to unhose the distrib...
Small tweak to nextString to unhose the distribution.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/util/Random.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala index b88411605f..50a038b032 100644 --- a/src/library/scala/util/Random.scala +++ b/src/library/scala/util/Random.scala @@ -82,7 +82,7 @@ class Random(val self: java.util.Random) { try new String(Array(ch), 0, 1) toList catch { case _: IllegalArgumentException => Nil } - Stream continually toChar(nextInt()) flatMap (x => x) take length mkString + Stream continually toChar(Math.abs(nextInt()) % (1 << 16)) flatMap (x => x) take length mkString } def setSeed(seed: Long) { self.setSeed(seed) } |