equal
deleted
inserted
replaced
220 * be {@code minCapacity}. |
220 * be {@code minCapacity}. |
221 * |
221 * |
222 * @param minCapacity the desired minimum capacity |
222 * @param minCapacity the desired minimum capacity |
223 */ |
223 */ |
224 public synchronized void ensureCapacity(int minCapacity) { |
224 public synchronized void ensureCapacity(int minCapacity) { |
225 modCount++; |
225 if (minCapacity > 0) { |
226 ensureCapacityHelper(minCapacity); |
226 modCount++; |
|
227 ensureCapacityHelper(minCapacity); |
|
228 } |
227 } |
229 } |
228 |
230 |
229 /** |
231 /** |
230 * This implements the unsynchronized semantics of ensureCapacity. |
232 * This implements the unsynchronized semantics of ensureCapacity. |
231 * Synchronized methods in this class can internally call this |
233 * Synchronized methods in this class can internally call this |