DoxigAlpha

shrinkRetainingCapacity

Reduce length to new_len. Invalidates pointers to elements items[new_len..]. Keeps capacity the same. Asserts that the new length is less than or equal to the previous length.

Function parameters

Parameters

#
self:*Self
new_len:usize

Deprecated.

Functions

#
Managed
Deprecated.
AlignedManaged
Deprecated.
Aligned
A contiguous, growable list of arbitrarily aligned items in memory.

Source

Implementation

#
pub fn shrinkRetainingCapacity(self: *Self, new_len: usize) void {
    assert(new_len <= self.items.len);
    self.items.len = new_len;
}