diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-05-09 15:27:01 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-05-09 15:27:01 +0200 |
commit | 7bac372a85e5a06ec147ec648caab76df704d8dc (patch) | |
tree | 18e4b7aa8eb345d67ed796fe3661ec39350cb2e2 /src | |
parent | d32459b8ca1164a1fde801397396218a216b7670 (diff) | |
parent | b154269b0e7447cfbf7fdb73c8c4efcdca545b11 (diff) | |
download | scala-7bac372a85e5a06ec147ec648caab76df704d8dc.tar.gz scala-7bac372a85e5a06ec147ec648caab76df704d8dc.tar.bz2 scala-7bac372a85e5a06ec147ec648caab76df704d8dc.zip |
Merge pull request #3727 from retronym/ticket/8531
SI-8531 Better space efficiency for patmat analysis
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/patmat/Solving.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/Solving.scala b/src/compiler/scala/tools/nsc/transform/patmat/Solving.scala index 1902606d86..31b1ffa912 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/Solving.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/Solving.scala @@ -29,8 +29,12 @@ trait Solving extends Logic { type Clause = collection.Set[Lit] // a clause is a disjunction of distinct literals def clause(l: Lit*): Clause = ( - // neg/t7020.scala changes output 1% of the time, the non-determinism is quelled with this linked set - mutable.LinkedHashSet(l: _*) + if (l.lengthCompare(1) <= 0) { + l.toSet // SI-8531 Avoid LinkedHashSet's bulk for 0 and 1 element clauses + } else { + // neg/t7020.scala changes output 1% of the time, the non-determinism is quelled with this linked set + mutable.LinkedHashSet(l: _*) + } ) type Lit |