diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-31 09:12:32 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-31 09:12:32 +0000 |
commit | 86834347c36c05d050be921ef4786c036735c0da (patch) | |
tree | d4e74c0989ae19c722f19107c2a23426eff0ded1 /src | |
parent | 4db73388f2d63eb9b57fecfbd0d76203d7a71c18 (diff) | |
download | scala-86834347c36c05d050be921ef4786c036735c0da.tar.gz scala-86834347c36c05d050be921ef4786c036735c0da.tar.bz2 scala-86834347c36c05d050be921ef4786c036735c0da.zip |
Off by one error in nextPrintableChar.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/util/Random.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala index 53e721dcda..4169ba3b73 100644 --- a/src/library/scala/util/Random.scala +++ b/src/library/scala/util/Random.scala @@ -94,7 +94,8 @@ class Random(val self: java.util.Random) { * from the ASCII range 33-126. */ def nextPrintableChar(): Char = { - val (low, high) = (33, 126) + val low = 33 + val high = 127 (self.nextInt(high - low) + low).toChar } |