clear

open override fun clear()(source)

Removes all elements while retaining backing capacity for reuse.

Clears the occupied storage slots and sets size to zero. Every call invalidates existing iterators, including calls on an already empty list.