KT-737 compareTo() intrinsic

This commit is contained in:
Alex Tkachman
2011-12-03 20:51:56 +02:00
parent 90367ab138
commit 1135c8ce7a
5 changed files with 68 additions and 1 deletions
+12
View File
@@ -17,6 +17,18 @@ public class Intrinsics {
throw new JetNullPointerException();
}
public static int compare(long thisVal, long anotherVal) {
return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1));
}
public static int compare(int thisVal, int anotherVal) {
return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1));
}
public static int compare(boolean thisVal, boolean anotherVal) {
return (thisVal == anotherVal ? 0 : (anotherVal ? 1 : -1));
}
private static Throwable sanitizeStackTrace(Throwable throwable) {
StackTraceElement[] stackTrace = throwable.getStackTrace();
ArrayList<StackTraceElement> list = new ArrayList<StackTraceElement>();