DoxigAlpha

changeLengthAssumeCapacity

Function parameters

Parameters

#
len:u32
builder:*Builder

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#

= 16

Values

#

Source

Implementation

#
pub fn changeLengthAssumeCapacity(self: Type, len: u32, builder: *Builder) Type {
    const item = builder.type_items.items[@intFromEnum(self)];
    return switch (item.tag) {
        inline .vector,
        .scalable_vector,
        => |kind| builder.vectorTypeAssumeCapacity(
            switch (kind) {
                .vector => .normal,
                .scalable_vector => .scalable,
                else => unreachable,
            },
            len,
            builder.typeExtraData(Type.Vector, item.data).child,
        ),
        .small_array => builder.arrayTypeAssumeCapacity(
            len,
            builder.typeExtraData(Type.Vector, item.data).child,
        ),
        .array => builder.arrayTypeAssumeCapacity(
            len,
            builder.typeExtraData(Type.Array, item.data).child,
        ),
        else => unreachable,
    };
}