ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/ArraysSort.java
(Generate patch)

Comparing jsr166/src/test/loops/ArraysSort.java (file contents):
Revision 1.2 by jsr166, Sat Aug 1 00:05:58 2015 UTC vs.
Revision 1.4 by jsr166, Sat Sep 12 19:09:00 2015 UTC

# Line 15 | Line 15 | class ArraysSort {
15      static final Comparator<Object> cmp = (Object x, Object y) ->
16          ((Long)x).compareTo((Long)y);
17  
18
18      public static void main(String[] args) throws Exception {
19          int n = 1 << 22;
20          int reps = 30;
# Line 122 | Line 121 | class ArraysSort {
121  
122      static void checkSorted(Long[] a) {
123          int n = a.length;
124 <        long x = ((Long)a[0]).longValue(), y;
124 >        long x = a[0].longValue(), y;
125          for (int i = 0; i < n - 1; i++) {
126 <            if (x > (y = ((Long)a[i+1]).longValue()))
126 >            if (x > (y = a[i+1].longValue()))
127                  throw new Error("Unsorted at " + i + ": " + x + " / " + y);
128              x = y;
129          }
# Line 185 | Line 184 | class ArraysSort {
184              }
185              int bound = h < n ? h : n - 1;
186              int i = l;
187 <            long x = ((Long)a[i]).longValue(), y;
187 >            long x = a[i].longValue(), y;
188              while (i < bound) {
189 <                if (x > (y = ((Long)a[++i]).longValue()))
189 >                if (x > (y = a[++i].longValue()))
190                      throw new Error("Unsorted " + x + " / " + y);
191                  x = y;
192              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines