Skip to content

Commit 9f02e81

Browse files
committed
Micro-optimization: touch fewer denotations
1 parent 674d375 commit 9f02e81

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
785785
def tupleArgs(tree: Tree)(using Context): List[Tree] = tree match {
786786
case Block(Nil, expr) => tupleArgs(expr)
787787
case Inlined(_, Nil, expr) => tupleArgs(expr)
788-
case Apply(fn, args)
789-
if fn.symbol.name == nme.apply &&
788+
case Apply(fn: NameTree, args)
789+
if fn.name == nme.apply &&
790790
fn.symbol.owner.is(Module) &&
791791
defn.isTupleClass(fn.symbol.owner.companionClass) => args
792792
case _ => Nil

compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class FunctionXXLForwarders extends MiniPhase with IdentityDenotTransformer {
4141

4242
val forwarders =
4343
for {
44-
tree <- if (impl.symbol.owner.is(Trait)) Nil else impl.body
45-
if tree.symbol.is(Method) && tree.symbol.name == nme.apply &&
44+
ddef: DefDef <- if (impl.symbol.owner.is(Trait)) Nil else impl.body
45+
if ddef.name == nme.apply && tree.symbol.is(Method) &&
4646
tree.symbol.signature.paramsSig.size > MaxImplementedFunctionArity &&
4747
tree.symbol.allOverriddenSymbols.exists(sym => defn.isXXLFunctionClass(sym.owner))
4848
}

0 commit comments

Comments
 (0)