We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbe2304 commit ee4b125Copy full SHA for ee4b125
compiler/src/dotty/tools/dotc/ast/Trees.scala
@@ -1379,11 +1379,13 @@ object Trees {
1379
// Ties the knot of the traversal: call `foldOver(x, tree))` to dive in the `tree` node.
1380
def apply(x: X, tree: Tree)(using Context): X
1381
1382
- def apply(x: X, trees: List[Tree])(using Context): X = trees match
1383
- case tree :: rest =>
1384
- apply(apply(x, tree), rest)
1385
- case Nil =>
1386
- x
+ def apply(x: X, trees: List[Tree])(using Context): X =
+ var acc = x
+ var list = trees
+ while (!list.isEmpty) do
+ acc = apply(acc, list.head)
1387
+ list = list.tail
1388
+ acc
1389
1390
def foldOver(x: X, tree: Tree)(using Context): X =
1391
if (tree.source != ctx.source && tree.source.exists)
0 commit comments