diff options
author | David MacIver <david.maciver@gmail.com> | 2008-10-30 00:26:38 +0000 |
---|---|---|
committer | David MacIver <david.maciver@gmail.com> | 2008-10-30 00:26:38 +0000 |
commit | 9da19f07f16f96a2a55f0b48ec49573137cbca4b (patch) | |
tree | 70ac873b0c87b1025d7ffe77210cd13cc6b027e6 /src/compiler | |
parent | 583a2fda9fc6b9878ce379f5e779201e50815244 (diff) | |
download | scala-9da19f07f16f96a2a55f0b48ec49573137cbca4b.tar.gz scala-9da19f07f16f96a2a55f0b48ec49573137cbca4b.tar.bz2 scala-9da19f07f16f96a2a55f0b48ec49573137cbca4b.zip |
Minor control flow tinkering.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index c352856c1d..a01e31247d 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -86,22 +86,15 @@ trait ParallelMatching { } } - if (isEqualsPattern(column.head.tpe)) - new MixEquals(scrutinee, column, rest) - else if (column.head.isInstanceOf[ArrayValue]) { - if (isRightIgnoring(column.head.asInstanceOf[ArrayValue])) - new MixSequenceStar(scrutinee, column, rest) - else - new MixSequence(scrutinee, column, rest) + column.head match { + case x if isEqualsPattern(x.tpe) => new MixEquals(scrutinee, column, rest); + case (x : ArrayValue) => if (isRightIgnoring(x)) new MixSequenceStar(scrutinee, column, rest) + else new MixSequence(scrutinee, column, rest); + case _ if isSimpleSwitch => new MixLiterals(scrutinee, column, rest) + case _ if (settings_casetags && (column.length > 1) && isFlatCases(column)) => new MixCases(scrutinee, column, rest) + case _ if isUnapplyHead() => new MixUnapply(scrutinee, column, rest) + case _ => new MixTypes(scrutinee, column, rest) } - else if (isSimpleSwitch) - new MixLiterals(scrutinee, column, rest) - else if (settings_casetags && (column.length > 1) && isFlatCases(column)) - new MixCases(scrutinee, column, rest) - else if (isUnapplyHead()) - new MixUnapply(scrutinee, column, rest) - else - new MixTypes(scrutinee, column, rest) } sealed abstract class RuleApplication(rep: RepFactory) { |