317 |
|
final int s = size(), needed; |
318 |
|
if ((needed = s + c.size() - elements.length + 1) > 0) |
319 |
|
grow(needed); |
320 |
< |
c.forEach((e) -> addLast(e)); |
320 |
> |
c.forEach(e -> addLast(e)); |
321 |
|
// checkInvariants(); |
322 |
|
return size() > s; |
323 |
|
} |
469 |
|
final Object[] es = elements; |
470 |
|
for (int i = tail, end = head, to = (i >= end) ? end : 0; |
471 |
|
; i = es.length, to = end) { |
472 |
< |
while (--i >= to) |
472 |
> |
for (i--; i > to - 1; i--) |
473 |
|
if (o.equals(es[i])) { |
474 |
|
delete(i); |
475 |
|
return true; |
773 |
|
throw new ConcurrentModificationException(); |
774 |
|
for (int i = cursor, end = head, to = (i >= end) ? end : 0; |
775 |
|
; i = es.length - 1, to = end) { |
776 |
< |
for (; i >= to; i--) |
776 |
> |
// hotspot generates faster code than for: i >= to ! |
777 |
> |
for (; i > to - 1; i--) |
778 |
|
action.accept(elementAt(es, i)); |
779 |
|
if (to == end) { |
780 |
|
if (end != head) |
781 |
|
throw new ConcurrentModificationException(); |
782 |
< |
lastRet = head; |
782 |
> |
lastRet = end; |
783 |
|
break; |
784 |
|
} |
785 |
|
} |