ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/TimSort.java
(Generate patch)

Comparing jsr166/src/main/java/util/TimSort.java (file contents):
Revision 1.2 by jsr166, Tue Sep 1 22:17:49 2009 UTC vs.
Revision 1.3 by jsr166, Tue Sep 1 22:23:10 2009 UTC

# Line 14 | Line 14
14   * limitations under the License.
15   */
16  
17 < import java.util.*;
17 > package java.util;
18  
19   /**
20   * A stable, adaptive, iterative mergesort that requires far fewer than
# Line 46 | Line 46 | import java.util.*;
46   * (privately) instantiable; a TimSort instance holds the state of an ongoing
47   * sort, assuming the input array is large enough to warrant the full-blown
48   * TimSort. Small arrays are sorted in place, using a binary insertion sort.
49 + *
50 + * @author Josh Bloch
51   */
52   class TimSort<T> {
53      /**
# Line 175 | Line 177 | class TimSort<T> {
177  
178          // If array is small, do a "mini-TimSort" with no merges
179          if (nRemaining < MIN_MERGE) {
180 <            int initRunLen = countRunAndMakeAscending(a, lo, nRemaining, c);
180 >            int initRunLen = countRunAndMakeAscending(a, lo, hi, c);
181              binarySort(a, lo, hi, lo + initRunLen, c);
182              return;
183          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines