diff options
author | David MacIver <david.maciver@gmail.com> | 2008-10-26 19:54:41 +0000 |
---|---|---|
committer | David MacIver <david.maciver@gmail.com> | 2008-10-26 19:54:41 +0000 |
commit | 2f3d17b186ca09fd4205ccd3e16e4eef69b1469c (patch) | |
tree | 61e285e66da5ab162a3b44a0ab907d1d8994aa76 | |
parent | 22ef50488a216fee15e9a940f244d9118cdfac8e (diff) | |
download | scala-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.
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 15 |
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 |