authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-12-13 23:14:51+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-01 15:48:48-07:00
logbbab5e19b45436f9828ae988832c1e31b5861683
treeeff0492d8e0ce89af1e9908dc4febd68dc4ccf0e
parent4387e50d4fa058ebc064ec8bfae07ef78774a2f4

std: loop in trailer flags can be indexing operation


1 files changed, 1 insertions(+), 4 deletions(-)

lib/std/meta/trailer_flags.zig+1-4
...@@ -122,10 +122,7 @@ pub fn TrailerFlags(comptime Fields: type) type {...@@ -122,10 +122,7 @@ pub fn TrailerFlags(comptime Fields: type) type {
122 }122 }
123123
124 pub fn Field(comptime field: FieldEnum) type {124 pub fn Field(comptime field: FieldEnum) type {
125 inline for (@typeInfo(Fields).Struct.fields) |field_info, i| {125 return @typeInfo(Fields).Struct.fields[@enumToInt(field)].field_type;
126 if (i == @enumToInt(field))
127 return field_info.field_type;
128 }
129 }126 }
130127
131 pub fn sizeInBytes(self: Self) usize {128 pub fn sizeInBytes(self: Self) usize {