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

Comparing jsr166/src/main/java/util/PriorityQueue.java (file contents):
Revision 1.116 by jsr166, Sun Dec 18 21:52:10 2016 UTC vs.
Revision 1.118 by jsr166, Thu Dec 29 23:14:34 2016 UTC

# Line 522 | Line 522 | public class PriorityQueue<E> extends Ab
522           */
523          private int expectedModCount = modCount;
524  
525 +        Itr() {}                        // prevent access constructor creation
526 +
527          public boolean hasNext() {
528              return cursor < size ||
529                  (forgetMeNot != null && !forgetMeNot.isEmpty());
# Line 732 | Line 734 | public class PriorityQueue<E> extends Ab
734      @SuppressWarnings("unchecked")
735      private void heapify() {
736          final Object[] es = queue;
737 <        final int half = (size >>> 1) - 1;
737 >        int i = (size >>> 1) - 1;
738          if (comparator == null)
739 <            for (int i = half; i >= 0; i--)
739 >            for (; i >= 0; i--)
740                  siftDownComparable(i, (E) es[i]);
741          else
742 <            for (int i = half; i >= 0; i--)
742 >            for (; i >= 0; i--)
743                  siftDownUsingComparator(i, (E) es[i]);
744      }
745  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines