DoxigAlpha

appendNTimesAssumeCapacity

Append a value to the list n times. Never invalidates element pointers. The function is inline so that a comptime-known value parameter will have a more optimal memset codegen in case it has a repeated byte pattern. Asserts that the list can hold the additional items.

Function parameters

Parameters

#
self:*Self
value:T
n:usize

Deprecated.

Functions

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

Source

Implementation

#
pub inline fn appendNTimesAssumeCapacity(self: *Self, value: T, n: usize) void {
    const new_len = self.items.len + n;
    assert(new_len <= self.capacity);
    @memset(self.items.ptr[self.items.len..new_len], value);
    self.items.len = new_len;
}