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.125 by jsr166, Sun May 6 21:07:41 2018 UTC vs.
Revision 1.126 by jsr166, Sun May 6 23:07:56 2018 UTC

# Line 617 | Line 617 | public class PriorityQueue<E> extends Ab
617       */
618      E removeAt(int i) {
619          // assert i >= 0 && i < size;
620 +        final Object[] es = queue;
621          modCount++;
622          int s = --size;
623          if (s == i) // removed last element
624 <            queue[i] = null;
624 >            es[i] = null;
625          else {
626              E moved = (E) queue[s];
627 <            queue[s] = null;
627 >            es[s] = null;
628              siftDown(i, moved);
629 <            if (queue[i] == moved) {
629 >            if (es[i] == moved) {
630                  siftUp(i, moved);
631 <                if (queue[i] != moved)
631 >                if (es[i] != moved)
632                      return moved;
633              }
634          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines