[cvs] / jsr166 / src / main / java / util / PriorityQueue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/PriorityQueue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.57, Mon Nov 28 02:44:06 2005 UTC revision 1.58, Mon Nov 28 23:53:32 2005 UTC
# Line 229  Line 229 
229          // Double size if small; else grow by 50%          // Double size if small; else grow by 50%
230          int newCapacity = ((oldCapacity < 64)?          int newCapacity = ((oldCapacity < 64)?
231                             ((oldCapacity + 1) * 2):                             ((oldCapacity + 1) * 2):
232                             ((oldCapacity * 3) / 2));                             ((oldCapacity / 2) * 3));
233            if (newCapacity < 0) // overflow
234                newCapacity = Integer.MAX_VALUE;
235          if (newCapacity < minCapacity)          if (newCapacity < minCapacity)
236              newCapacity = minCapacity;              newCapacity = minCapacity;
237          queue = Arrays.copyOf(queue, newCapacity);          queue = Arrays.copyOf(queue, newCapacity);

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8