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.3 by jsr166, Mon Aug 10 06:36:59 2015 UTC

# Line 122 | Line 122 | class ArraysSort {
122  
123      static void checkSorted(Long[] a) {
124          int n = a.length;
125 <        long x = ((Long)a[0]).longValue(), y;
125 >        long x = a[0].longValue(), y;
126          for (int i = 0; i < n - 1; i++) {
127 <            if (x > (y = ((Long)a[i+1]).longValue()))
127 >            if (x > (y = a[i+1].longValue()))
128                  throw new Error("Unsorted at " + i + ": " + x + " / " + y);
129              x = y;
130          }
# Line 185 | Line 185 | class ArraysSort {
185              }
186              int bound = h < n ? h : n - 1;
187              int i = l;
188 <            long x = ((Long)a[i]).longValue(), y;
188 >            long x = a[i].longValue(), y;
189              while (i < bound) {
190 <                if (x > (y = ((Long)a[++i]).longValue()))
190 >                if (x > (y = a[++i].longValue()))
191                      throw new Error("Unsorted " + x + " / " + y);
192                  x = y;
193              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines