pub fn attrs(self: *Builder, attributes: []Attribute.Index) Allocator.Error!Attributes 10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211pub fn attrs(self: *Builder, attributes: []Attribute.Index) Allocator.Error!Attributes {
std.sort.heap(Attribute.Index, attributes, self, struct {
pub fn lessThan(builder: *const Builder, lhs: Attribute.Index, rhs: Attribute.Index) bool {
const lhs_kind = lhs.getKind(builder);
const rhs_kind = rhs.getKind(builder);
assert(lhs_kind != rhs_kind);
return @backingInt(lhs_kind) < @backingInt(rhs_kind);
}
}.lessThan);
return @fromBackingInt(try self.attrGeneric(@ptrCast(attributes)));
}