1174 |
|
|
1175 |
|
public Spliterator<E> trySplit() { |
1176 |
|
Node<E> h; |
1177 |
– |
int b = batch; |
1178 |
– |
int n = (b <= 0) ? 1 : (b >= MAX_BATCH) ? MAX_BATCH : b + 1; |
1177 |
|
if (!exhausted && |
1178 |
|
((h = current) != null || (h = first) != null) |
1179 |
|
&& h.next != null) { |
1180 |
+ |
int n = batch = Math.min(batch + 1, MAX_BATCH); |
1181 |
|
Object[] a = new Object[n]; |
1182 |
|
final ReentrantLock lock = LinkedBlockingDeque.this.lock; |
1183 |
|
int i = 0; |
1198 |
|
} |
1199 |
|
else if ((est -= i) < 0L) |
1200 |
|
est = 0L; |
1201 |
< |
if (i > 0) { |
1203 |
< |
batch = i; |
1201 |
> |
if (i > 0) |
1202 |
|
return Spliterators.spliterator |
1203 |
|
(a, 0, i, (Spliterator.ORDERED | |
1204 |
|
Spliterator.NONNULL | |
1205 |
|
Spliterator.CONCURRENT)); |
1208 |
– |
} |
1206 |
|
} |
1207 |
|
return null; |
1208 |
|
} |