509 |
|
try { |
510 |
|
if (count > 0) { |
511 |
|
final Object[] items = this.items; |
512 |
< |
final int putIndex = this.putIndex; |
513 |
< |
int i = takeIndex; |
514 |
< |
do { |
515 |
< |
if (o.equals(items[i])) |
516 |
< |
return true; |
517 |
< |
if (++i == items.length) i = 0; |
518 |
< |
} while (i != putIndex); |
512 |
> |
for (int i = takeIndex, end = putIndex, |
513 |
> |
to = (i < end) ? end : items.length; |
514 |
> |
; i = 0, to = end) { |
515 |
> |
for (; i < to; i++) |
516 |
> |
if (o.equals(items[i])) |
517 |
> |
return true; |
518 |
> |
if (to == end) break; |
519 |
> |
} |
520 |
|
} |
521 |
|
return false; |
522 |
|
} finally { |