diff options
| author | daurnimator <quae@daurnimator.com> | 2020-12-13 23:14:51 +1100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-01 15:48:48 -0700 |
| commit | bbab5e19b45436f9828ae988832c1e31b5861683 (patch) | |
| tree | eff0492d8e0ce89af1e9908dc4febd68dc4ccf0e | |
| parent | 4387e50d4fa058ebc064ec8bfae07ef78774a2f4 (diff) | |
| download | zig-bbab5e19b45436f9828ae988832c1e31b5861683.tar.gz zig-bbab5e19b45436f9828ae988832c1e31b5861683.zip | |
std: loop in trailer flags can be indexing operation
| -rw-r--r-- | lib/std/meta/trailer_flags.zig | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/std/meta/trailer_flags.zig b/lib/std/meta/trailer_flags.zig index 09c75b3d78..a5882d9e1b 100644 --- a/lib/std/meta/trailer_flags.zig +++ b/lib/std/meta/trailer_flags.zig @@ -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 { |
