Streamline LinkedTransferQueue.isEmpty()
This commit is contained in:
parent
11705c9915
commit
a2ef43cf3d
@ -1241,7 +1241,12 @@ public class LinkedTransferQueue<E> extends AbstractQueue<E>
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return firstOfMode(true) == null;
|
for (Node p = head; p != null; p = succ(p)) {
|
||||||
|
if (!p.isMatched()) {
|
||||||
|
return !p.isData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasWaitingConsumer() {
|
public boolean hasWaitingConsumer() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user