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; |
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; |