Skip to content

Commit b955c4f

Browse files
committed
Avoid temporary list creation in typeDefDef
1 parent 141a72f commit b955c4f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,10 +2351,9 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
23512351
StarWithDefaultError(meth)
23522352

23532353
if (!isPastTyper) {
2354-
val allParams = meth.paramss.flatten
2355-
for (p <- allParams) {
2354+
mforeach(meth.paramss) { p =>
23562355
for (n <- p.deprecatedParamName) {
2357-
if (allParams.exists(p1 => p != p1 && (p1.name == n || p1.deprecatedParamName.exists(_ == n))))
2356+
if (mexists(meth.paramss)(p1 => p != p1 && (p1.name == n || p1.deprecatedParamName.exists(_ == n))))
23582357
DeprecatedParamNameError(p, n)
23592358
}
23602359
}

0 commit comments

Comments
 (0)