ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.143 by jsr166, Thu Jun 11 17:04:16 2020 UTC vs.
Revision 1.144 by jsr166, Thu Jun 11 17:17:45 2020 UTC

# Line 262 | Line 262 | public class PriorityBlockingQueue<E> ex
262          if (allocationSpinLock == 0 &&
263              ALLOCATIONSPINLOCK.compareAndSet(this, 0, 1)) {
264              try {
265 <                int growth = oldCap < 64 ? oldCap + 2 : oldCap >> 1;
265 >                int growth = (oldCap < 64)
266 >                    ? (oldCap + 2) // grow faster if small
267 >                    : (oldCap >> 1);
268                  int newCap = ArraysSupport.newLength(oldCap, 1, growth);
269                  if (queue == array)
270                      newArray = new Object[newCap];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines