aboutsummaryrefslogblamecommitdiff
path: root/tests/run/adding-growing-set.scala
blob: ab94b893b20aed2304a1a758b07091fa2c294ba5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                          
/** This will run a loooong time if Set's builder copies a
 *  complete new Set for every element.
 */
object Test {
  def main(args: Array[String]): Unit = {
    val a = new Array[Long](1000000)
    (1 to 10000) foreach (i => a(i) = i)
    val s = collection.mutable.Set(a: _*)
    assert(s.sum > 0)
  }
}