1377 |
|
Node<E> p; int n; |
1378 |
|
final ConcurrentLinkedDeque<E> q = this.queue; |
1379 |
|
if (!exhausted && (n = batch + 1) > 0 && n <= MAX_BATCH && |
1380 |
< |
((p = current) != null || (p = q.first()) != null) && |
1381 |
< |
p.next != null) { |
1382 |
< |
Object[] a = new Object[batch = n]; |
1383 |
< |
int i = 0; |
1384 |
< |
do { |
1385 |
< |
if ((a[i] = p.item) != null) |
1386 |
< |
++i; |
1387 |
< |
if (p == (p = p.next)) |
1388 |
< |
p = q.first(); |
1389 |
< |
} while (p != null && i < n); |
1390 |
< |
if ((current = p) == null) |
1391 |
< |
exhausted = true; |
1392 |
< |
return Spliterators.spliterator |
1393 |
< |
(a, 0, i, Spliterator.ORDERED | Spliterator.NONNULL | |
1394 |
< |
Spliterator.CONCURRENT); |
1380 |
> |
((p = current) != null || (p = q.first()) != null)) { |
1381 |
> |
if (p.item == null && p == (p = p.next)) |
1382 |
> |
current = p = q.first(); |
1383 |
> |
if (p.next != null) { |
1384 |
> |
Object[] a = new Object[batch = n]; |
1385 |
> |
int i = 0; |
1386 |
> |
do { |
1387 |
> |
if ((a[i] = p.item) != null) |
1388 |
> |
++i; |
1389 |
> |
if (p == (p = p.next)) |
1390 |
> |
p = q.first(); |
1391 |
> |
} while (p != null && i < n); |
1392 |
> |
if ((current = p) == null) |
1393 |
> |
exhausted = true; |
1394 |
> |
return Spliterators.spliterator |
1395 |
> |
(a, 0, i, Spliterator.ORDERED | Spliterator.NONNULL | |
1396 |
> |
Spliterator.CONCURRENT); |
1397 |
> |
} |
1398 |
|
} |
1399 |
|
return null; |
1400 |
|
} |