MCPcopy
hub / github.com/libgdx/libgdx / shrink

Method shrink

gdx/src/com/badlogic/gdx/utils/Array.java:461–464  ·  view source on GitHub ↗

Reduces the size of the backing array to the size of the actual items. This is useful to release memory when many items have been removed, or if it is known that more items will not be added. @return #items

()

Source from the content-addressed store, hash-verified

459 * have been removed, or if it is known that more items will not be added.
460 * @return {@link #items} */
461 public T[] shrink () {
462 if (items.length != size) resize(size);
463 return items;
464 }
465
466 /** Increases the size of the backing array to accommodate the specified number of additional items. Useful before adding many
467 * items to avoid multiple backing array resizes.

Callers 2

getAttributeLocationsMethod · 0.45

Calls 1

resizeMethod · 0.95

Tested by

no test coverage detected