summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Nadezhin <Dmitry.Nadezhin@gmail.com>2012-04-07 21:46:49 +0400
committerDmitry Nadezhin <Dmitry.Nadezhin@gmail.com>2012-04-07 21:46:49 +0400
commit9574fd3b598f716fe55b43b9636daf791ba008d5 (patch)
tree5ad6890a9627f70b166418079eef73f7ad37366f /src
parent1a6408c42928211d5d119317cc1aec4eb2481101 (diff)
downloadscala-9574fd3b598f716fe55b43b9636daf791ba008d5.tar.gz
scala-9574fd3b598f716fe55b43b9636daf791ba008d5.tar.bz2
scala-9574fd3b598f716fe55b43b9636daf791ba008d5.zip
Small simplification of commit 87c9fc0df0f0e74d3a07f95634356d6425877091.
eqTypeCode(Number) is equivalent to typeCode(Number). CHAR code is impossible because java.lang.Character is not subclass of java.lang.Number.
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/runtime/BoxesRunTime.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/library/scala/runtime/BoxesRunTime.java b/src/library/scala/runtime/BoxesRunTime.java
index 94047d6f53..258a176671 100644
--- a/src/library/scala/runtime/BoxesRunTime.java
+++ b/src/library/scala/runtime/BoxesRunTime.java
@@ -44,14 +44,6 @@ public final class BoxesRunTime
return OTHER;
}
- private static int eqTypeCode(Number a) {
- int code = typeCode(a);
- if (code == CHAR)
- return OTHER;
- else
- return code;
- }
-
private static String boxDescription(Object a) {
return "" + a.getClass().getSimpleName() + "(" + a + ")";
}
@@ -160,8 +152,8 @@ public final class BoxesRunTime
}
public static boolean equalsNumNum(java.lang.Number xn, java.lang.Number yn) {
- int xcode = eqTypeCode(xn);
- int ycode = eqTypeCode(yn);
+ int xcode = typeCode(xn);
+ int ycode = typeCode(yn);
switch (ycode > xcode ? ycode : xcode) {
case INT:
return xn.intValue() == yn.intValue();
@@ -197,7 +189,7 @@ public final class BoxesRunTime
return xn == null;
char ch = yc.charValue();
- switch (eqTypeCode(xn)) {
+ switch (typeCode(xn)) {
case INT:
return xn.intValue() == ch;
case LONG: