Skip to content

Commit 040ccf2

Browse files
committed
Patrial port of 096bc3b
1 parent f287f58 commit 040ccf2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,13 +1237,16 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
12371237
}
12381238
}
12391239

1240-
val testOpForPrimitive: Array[TestOp] = {
1241-
import Primitives._
1242-
1243-
Array(
1244-
EQ, NE, EQ, NE, LT, LE, GE, GT
1245-
)
1246-
}
1240+
def testOpForPrimitive(primitiveCode: Int) = (primitiveCode: @switch) match {
1241+
case ScalaPrimitivesOps.ID => Primitives.EQ
1242+
case ScalaPrimitivesOps.NI => Primitives.NE
1243+
case ScalaPrimitivesOps.EQ => Primitives.EQ
1244+
case ScalaPrimitivesOps.NE => Primitives.NE
1245+
case ScalaPrimitivesOps.LT => Primitives.LT
1246+
case ScalaPrimitivesOps.LE => Primitives.LE
1247+
case ScalaPrimitivesOps.GE => Primitives.GE
1248+
case ScalaPrimitivesOps.GT => Primitives.GT
1249+
}
12471250

12481251
/*
12491252
* Generate code for conditional expressions.

0 commit comments

Comments
 (0)