diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-01 07:29:42 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-01 07:29:42 -0700 |
commit | 6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62 (patch) | |
tree | caebb02fd12a0075f5eacc3acaac754766f10f0d /test/files/run/streams.scala | |
parent | e3f4f199dcf012200ddf04e2871de93477474073 (diff) | |
parent | 4e4060f4faee791759417f1a598322e90623464d (diff) | |
download | scala-6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62.tar.gz scala-6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62.tar.bz2 scala-6f273cb58ba69cc8b30ec9b1b31dc015e0ef1a62.zip |
Merge pull request #1535 from paulp/stream-distinct
Fix SI-6584, Stream#distinct uses too much memory.
Diffstat (limited to 'test/files/run/streams.scala')
-rw-r--r-- | test/files/run/streams.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/files/run/streams.scala b/test/files/run/streams.scala index 51b4e5d76c..dc5d0204ac 100644 --- a/test/files/run/streams.scala +++ b/test/files/run/streams.scala @@ -29,7 +29,7 @@ object Test extends App { def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None println(s3.flatMap(powers).reverse.head) - // large enough to generate StackOverflows (on most systems) + // large enough to generate StackOverflows (on most systems) // unless the following methods are tail call optimized. val size = 100000 @@ -43,4 +43,7 @@ object Test extends App { println(Stream.from(1).take(size).foldLeft(0)(_ + _)) val arr = new Array[Int](size) Stream.from(1).take(size).copyToArray(arr, 0) + + // dropRight terminates + println(Stream from 1 dropRight 1000 take 3 sum) } |