summaryrefslogblamecommitdiff
path: root/test/files/run/adding-growing-set.scala
blob: 5903813ed17a759d4ac46556e766861d55f2e849 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                            
/** This will run a 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)
  }
}