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

Comparing jsr166/src/main/java/util/ArrayDeque.java (file contents):
Revision 1.106 by jsr166, Sat Nov 5 00:25:44 2016 UTC vs.
Revision 1.108 by jsr166, Sat Nov 5 14:41:14 2016 UTC

# Line 475 | Line 475 | public class ArrayDeque<E> extends Abstr
475      public boolean removeLastOccurrence(Object o) {
476          if (o != null) {
477              final Object[] es = elements;
478 <            for (int i = last(), end = head - 1, to = (i >= end) ? end : -1;
479 <                 ; i = es.length - 1, to = end) {
480 <                for (; i > to; i--)
478 >            for (int i = tail, end = head, to = (i >= end) ? end : 0;
479 >                 ; i = es.length, to = end) {
480 >                while (--i >= to)
481                      if (o.equals(es[i])) {
482                          delete(i);
483                          return true;
# Line 779 | Line 779 | public class ArrayDeque<E> extends Abstr
779              final Object[] es = elements;
780              if (es[cursor] == null || sub(cursor, head, es.length) + 1 != r)
781                  throw new ConcurrentModificationException();
782 <            for (int i = cursor, end = head - 1, to = (i >= end) ? end : -1;
782 >            for (int i = cursor, end = head, to = (i >= end) ? end : 0;
783                   ; i = es.length - 1, to = end) {
784 <                for (; i > to; i--)
784 >                for (; i >= to; i--)
785                      action.accept(elementAt(es, i));
786                  if (to == end) {
787 <                    if (end != head - 1)
787 >                    if (end != head)
788                          throw new ConcurrentModificationException();
789                      lastRet = head;
790                      break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines