423 |
|
public boolean contains(Object o) { |
424 |
|
if (o == null) return false; |
425 |
|
restartFromHead: for (;;) { |
426 |
< |
for (Node<E> p = head, c = p, pred = null, q; p != null; p = q) { |
426 |
> |
for (Node<E> p = head, c = p, pred = null, q; p != null; ) { |
427 |
|
final E item; |
428 |
|
if ((item = p.item) != null && o.equals(item)) |
429 |
|
return true; |
432 |
|
q = p.next; |
433 |
|
if (item != null || c != p) { |
434 |
|
pred = p; |
435 |
< |
c = q; |
435 |
> |
p = c = q; |
436 |
|
} |
437 |
< |
else if (p == q) |
437 |
> |
else if (p == (p = q)) |
438 |
|
continue restartFromHead; |
439 |
|
} |
440 |
|
return false; |
455 |
|
public boolean remove(Object o) { |
456 |
|
if (o == null) return false; |
457 |
|
restartFromHead: for (;;) { |
458 |
< |
for (Node<E> p = head, c = p, pred = null, q; p != null; p = q) { |
458 |
> |
for (Node<E> p = head, c = p, pred = null, q; p != null; ) { |
459 |
|
final E item; |
460 |
|
final boolean removed = |
461 |
|
(item = p.item) != null |
468 |
|
q = p.next; |
469 |
|
if (item != null || c != p) { |
470 |
|
pred = p; |
471 |
< |
c = q; |
471 |
> |
p = c = q; |
472 |
|
} |
473 |
< |
else if (p == q) |
473 |
> |
else if (p == (p = q)) |
474 |
|
continue restartFromHead; |
475 |
|
} |
476 |
|
return false; |