Added intrinsics for nullable Double/Float equals check
This commit is contained in:
@@ -163,6 +163,30 @@ public class Intrinsics {
|
||||
return first == null ? second == null : first.equals(second);
|
||||
}
|
||||
|
||||
public static boolean areEqual(Double first, Double second) {
|
||||
return first == null ? second == null : second != null && first.doubleValue() == second.doubleValue();
|
||||
}
|
||||
|
||||
public static boolean areEqual(Double first, double second) {
|
||||
return first != null && first.doubleValue() == second;
|
||||
}
|
||||
|
||||
public static boolean areEqual(double first, Double second) {
|
||||
return second != null && first == second.doubleValue();
|
||||
}
|
||||
|
||||
public static boolean areEqual(Float first, Float second) {
|
||||
return first == null ? second == null : second != null && first.floatValue() == second.floatValue();
|
||||
}
|
||||
|
||||
public static boolean areEqual(Float first, float second) {
|
||||
return first != null && first.floatValue() == second;
|
||||
}
|
||||
|
||||
public static boolean areEqual(float first, Float second) {
|
||||
return second != null && first == second.floatValue();
|
||||
}
|
||||
|
||||
public static void throwUndefinedForReified() {
|
||||
throwUndefinedForReified(
|
||||
"This function has a reified type parameter and thus can only be inlined at compilation time, not called directly."
|
||||
|
||||
Reference in New Issue
Block a user