|
27 | 27 | import java.io.Serializable; |
28 | 28 |
|
29 | 29 | import javaemul.internal.ArrayHelper; |
| 30 | +import javaemul.internal.LongCompareHolder; |
30 | 31 |
|
31 | 32 | /** |
32 | 33 | * Utility methods related to native arrays. <a |
@@ -1010,7 +1011,7 @@ public static void sort(int[] array, int fromIndex, int toIndex) { |
1010 | 1011 | } |
1011 | 1012 |
|
1012 | 1013 | public static void sort(long[] array) { |
1013 | | - nativeLongSort(array); |
| 1014 | + nativeLongSort(array, LongCompareHolder.getLongComparator()); |
1014 | 1015 | } |
1015 | 1016 |
|
1016 | 1017 | public static void sort(long[] array, int fromIndex, int toIndex) { |
@@ -1356,16 +1357,16 @@ private static void mergeSort(Object[] temp, Object[] array, int low, |
1356 | 1357 | /** |
1357 | 1358 | * Sort an entire array of number primitives. |
1358 | 1359 | */ |
1359 | | - private static native void nativeLongSort(Object array) /*-{ |
1360 | | - array.sort(@com.google.gwt.lang.LongLib::compare(*)); |
| 1360 | + private static native void nativeLongSort(Object array, Object compareFunction) /*-{ |
| 1361 | + array.sort(compareFunction); |
1361 | 1362 | }-*/; |
1362 | 1363 |
|
1363 | 1364 | /** |
1364 | 1365 | * Sort a subset of an array of number primitives. |
1365 | 1366 | */ |
1366 | 1367 | private static void nativeLongSort(Object array, int fromIndex, int toIndex) { |
1367 | 1368 | Object temp = ArrayHelper.unsafeClone(array, fromIndex, toIndex); |
1368 | | - nativeLongSort(temp); |
| 1369 | + nativeLongSort(temp, LongCompareHolder.getLongComparator()); |
1369 | 1370 | ArrayHelper.copy(temp, 0, array, fromIndex, toIndex - fromIndex); |
1370 | 1371 | } |
1371 | 1372 |
|
|
0 commit comments