MCPcopy Index your code
hub / github.com/davidgiven/luje / ensureCapacity

Method ensureCapacity

lib/java/util/ArrayList.java:323–333  ·  view source on GitHub ↗

Ensures that after this operation the ArrayList can hold the specified number of elements without further growing. @param minimumCapacity the minimum capacity asked for.

(int minimumCapacity)

Source from the content-addressed store, hash-verified

321 * the minimum capacity asked for.
322 */
323 public void ensureCapacity(int minimumCapacity) {
324 if (array.length < minimumCapacity) {
325 // REVIEW: Why do we check the firstIndex first? Growing
326 // the end makes more sense
327 if (firstIndex > 0) {
328 growAtFront(minimumCapacity - array.length);
329 } else {
330 growAtEnd(minimumCapacity - array.length);
331 }
332 }
333 }
334
335 @Override
336 public E get(int location) {

Callers

nothing calls this directly

Calls 2

growAtFrontMethod · 0.95
growAtEndMethod · 0.95

Tested by

no test coverage detected