236 |
|
*/ |
237 |
|
int n = start - left; // The number of elements to move |
238 |
|
// Switch is just an optimization for arraycopy in default case |
239 |
< |
switch(n) { |
239 |
> |
switch (n) { |
240 |
|
case 2: a[left + 2] = a[left + 1]; |
241 |
|
case 1: a[left + 1] = a[left]; |
242 |
|
break; |
279 |
|
|
280 |
|
// Find end of run, and reverse range if descending |
281 |
|
if (((Comparable) a[runHi++]).compareTo(a[lo]) < 0) { // Descending |
282 |
< |
while(runHi < hi && ((Comparable) a[runHi]).compareTo(a[runHi - 1]) < 0) |
282 |
> |
while (runHi < hi && ((Comparable) a[runHi]).compareTo(a[runHi - 1]) < 0) |
283 |
|
runHi++; |
284 |
|
reverseRange(a, lo, runHi); |
285 |
|
} else { // Ascending |