std: loop in trailer flags can be indexing operation
This commit is contained in:
committed by
Andrew Kelley
parent
4387e50d4f
commit
bbab5e19b4
@@ -122,10 +122,7 @@ pub fn TrailerFlags(comptime Fields: type) type {
|
||||
}
|
||||
|
||||
pub fn Field(comptime field: FieldEnum) type {
|
||||
inline for (@typeInfo(Fields).Struct.fields) |field_info, i| {
|
||||
if (i == @enumToInt(field))
|
||||
return field_info.field_type;
|
||||
}
|
||||
return @typeInfo(Fields).Struct.fields[@enumToInt(field)].field_type;
|
||||
}
|
||||
|
||||
pub fn sizeInBytes(self: Self) usize {
|
||||
|
||||
Reference in New Issue
Block a user