Skip to content

Commit ea5fb1f

Browse files
committed
Remove redundant extraction
1 parent a24625f commit ea5fb1f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,8 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
782782
if (invokeStyle.hasInstance) genLoadQualifier(fun)
783783
genLoadArguments(args, paramTKs(app))
784784

785-
val DesugaredSelect(qual, _) = fun // fun is a Select, also checked in genLoadQualifier
786-
val isArrayClone = fun match {
787-
case DesugaredSelect(qual, nme.clone_) if qual.tpe.widen.isInstanceOf[JavaArrayType] => true
788-
case _ => false
789-
}
785+
val DesugaredSelect(qual, name) = fun // fun is a Select, also checked in genLoadQualifier
786+
val isArrayClone = name == nme.clone_ && qual.tpe.widen.isInstanceOf[JavaArrayType]
790787
if (isArrayClone) {
791788
// Special-case Array.clone, introduced in 36ef60e. The goal is to generate this call
792789
// as "[I.clone" instead of "java/lang/Object.clone". This is consistent with javac.

0 commit comments

Comments
 (0)