summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid MacIver <david.maciver@gmail.com>2008-10-26 19:54:41 +0000
committerDavid MacIver <david.maciver@gmail.com>2008-10-26 19:54:41 +0000
commit2f3d17b186ca09fd4205ccd3e16e4eef69b1469c (patch)
tree61e285e66da5ab162a3b44a0ab907d1d8994aa76 /src
parent22ef50488a216fee15e9a940f244d9118cdfac8e (diff)
downloadscala-2f3d17b186ca09fd4205ccd3e16e4eef69b1469c.tar.gz
scala-2f3d17b186ca09fd4205ccd3e16e4eef69b1469c.tar.bz2
scala-2f3d17b186ca09fd4205ccd3e16e4eef69b1469c.zip
Patch from paulp to tidy up MixLiterals.getDefa...
Patch from paulp to tidy up MixLiterals.getDefaultRows.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 4def968e7b..c3c6f15edc 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -303,19 +303,10 @@ trait ParallelMatching {
protected override def haveDefault: Boolean = !defaultIndexSet.isEmpty
override def getDefaultRows: List[Row] = {
- if (theDefaultRows ne null)
- return theDefaultRows
+ if (theDefaultRows eq null)
+ theDefaultRows = defaultIndexSet.filter(defaultIndexSet(_)).toList.reverseMap(grabRow)
- var ix = defaultIndexSet.capacity;
- var res:List[Row] = Nil
- while((ix >= 0) && !defaultIndexSet(ix)) { ix = ix - 1 }
- while(ix >= 0) {
- res = grabRow(ix) :: res
- ix = ix - 1
- while((ix >= 0) && !defaultIndexSet(ix)) { ix = ix - 1 }
- }
- theDefaultRows = res
- res
+ theDefaultRows
}
var varMap: List[(Int,List[Symbol])] = Nil