904 |
|
unsplice(lastPred, lastRet); |
905 |
|
} |
906 |
|
} |
907 |
< |
|
907 |
> |
|
908 |
|
// Very similar to ConcurrentLinkedQueue spliterator |
909 |
|
static final class LTQSpliterator<E> implements Spliterator<E> { |
910 |
|
static final int MAX_BATCH = 1 << 10; // saturate batch size |
912 |
|
Node current; // current node; null until initialized |
913 |
|
int batch; // batch size for splits |
914 |
|
boolean exhausted; // true when no more nodes |
915 |
< |
LTQSpliterator(LinkedTransferQueue<E> queue) { |
915 |
> |
LTQSpliterator(LinkedTransferQueue<E> queue) { |
916 |
|
this.queue = queue; |
917 |
|
} |
918 |
|
|
934 |
|
do { |
935 |
|
if ((a[i] = p.item) != null) |
936 |
|
++i; |
937 |
< |
if (p == (p = p.next)) |
937 |
> |
if (p == (p = p.next)) |
938 |
|
p = q.firstDataNode(); |
939 |
|
} while (p != null && i < n); |
940 |
|
if ((current = p) == null) |
956 |
|
exhausted = true; |
957 |
|
do { |
958 |
|
Object e = p.item; |
959 |
< |
if (p == (p = p.next)) |
959 |
> |
if (p == (p = p.next)) |
960 |
|
p = q.firstDataNode(); |
961 |
|
if (e != null) |
962 |
|
action.accept((E)e); |
974 |
|
Object e; |
975 |
|
do { |
976 |
|
e = p.item; |
977 |
< |
if (p == (p = p.next)) |
977 |
> |
if (p == (p = p.next)) |
978 |
|
p = q.firstDataNode(); |
979 |
|
} while (e == null && p != null); |
980 |
|
if ((current = p) == null) |