修复BoundedPriorityBlockingQueue#offer方法一处细节问题

This commit is contained in:
everywhere.z
2024-09-20 16:06:02 +08:00
parent 0248a57697
commit e944aa7f4d

View File

@@ -49,7 +49,7 @@ public class BoundedPriorityBlockingQueue<E> extends PriorityBlockingQueue<E> {
if (size() >= capacity) {
E head = peek();
if (this.comparator().compare(e, head) <= 0) {
return true;
return false;
}
// 当队列满时,就要淘汰顶端队列
poll();