Removed extra branches. Only check for long first where we already know the

second type.
This commit is contained in:
Jack Conradson 2016-05-11 10:22:40 -07:00
parent 2764b47d22
commit 20af482dd7
1 changed files with 0 additions and 20 deletions

View File

@ -382,8 +382,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() * ((Number)right).doubleValue(); return ((Number)left).doubleValue() * ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() * ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() * ((Number)right).floatValue(); return ((Number)left).floatValue() * ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -427,8 +425,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() / ((Number)right).doubleValue(); return ((Number)left).doubleValue() / ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() / ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() / ((Number)right).floatValue(); return ((Number)left).floatValue() / ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -472,8 +468,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() % ((Number)right).doubleValue(); return ((Number)left).doubleValue() % ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() % ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() % ((Number)right).floatValue(); return ((Number)left).floatValue() % ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -519,8 +513,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() + ((Number)right).doubleValue(); return ((Number)left).doubleValue() + ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() + ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() + ((Number)right).floatValue(); return ((Number)left).floatValue() + ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -564,8 +556,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() - ((Number)right).doubleValue(); return ((Number)left).doubleValue() - ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() - ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() - ((Number)right).floatValue(); return ((Number)left).floatValue() - ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -822,8 +812,6 @@ public class Def {
} else if (left instanceof Character) { } else if (left instanceof Character) {
return (char)left == ((Number)right).doubleValue(); return (char)left == ((Number)right).doubleValue();
} }
} else if (left instanceof Long && right instanceof Long) {
return (long)left == (long)right;
} else if (left instanceof Float) { } else if (left instanceof Float) {
if (right instanceof Number) { if (right instanceof Number) {
return (float)left == ((Number)right).floatValue(); return (float)left == ((Number)right).floatValue();
@ -871,8 +859,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() < ((Number)right).doubleValue(); return ((Number)left).doubleValue() < ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() < ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() < ((Number)right).floatValue(); return ((Number)left).floatValue() < ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -916,8 +902,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() <= ((Number)right).doubleValue(); return ((Number)left).doubleValue() <= ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() <= ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() <= ((Number)right).floatValue(); return ((Number)left).floatValue() <= ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -961,8 +945,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() > ((Number)right).doubleValue(); return ((Number)left).doubleValue() > ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() > ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() > ((Number)right).floatValue(); return ((Number)left).floatValue() > ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {
@ -1006,8 +988,6 @@ public class Def {
if (right instanceof Number) { if (right instanceof Number) {
if (left instanceof Double || right instanceof Double) { if (left instanceof Double || right instanceof Double) {
return ((Number)left).doubleValue() >= ((Number)right).doubleValue(); return ((Number)left).doubleValue() >= ((Number)right).doubleValue();
} else if (left instanceof Long && right instanceof Long) {
return ((Number)left).longValue() >= ((Number)right).longValue();
} else if (left instanceof Float || right instanceof Float) { } else if (left instanceof Float || right instanceof Float) {
return ((Number)left).floatValue() >= ((Number)right).floatValue(); return ((Number)left).floatValue() >= ((Number)right).floatValue();
} else if (left instanceof Long || right instanceof Long) { } else if (left instanceof Long || right instanceof Long) {