| ... | ... | @@ -42,6 +42,7 @@ pub fn EnumFieldStruct(comptime E: type, comptime Data: type, comptime field_def |
| 42 | 42 | /// The result array is in the same order as the input. |
| 43 | 43 | pub inline fn valuesFromFields(comptime E: type, comptime fields: []const EnumField) []const E { |
| 44 | 44 | comptime { |
| 45 | @setEvalBranchQuota(@typeInfo(E).@"enum".fields.len + eval_branch_quota_cushion); |
| 45 | 46 | var result: [fields.len]E = undefined; |
| 46 | 47 | for (&result, fields) |*r, f| { |
| 47 | 48 | r.* = @enumFromInt(f.value); |
| ... | ... | @@ -53,7 +54,7 @@ pub inline fn valuesFromFields(comptime E: type, comptime fields: []const EnumFi |
| 53 | 54 | |
| 54 | 55 | /// Returns the set of all named values in the given enum, in |
| 55 | 56 | /// declaration order. |
| 56 | | pub fn values(comptime E: type) []const E { |
| 57 | pub inline fn values(comptime E: type) []const E { |
| 57 | 58 | return comptime valuesFromFields(E, @typeInfo(E).@"enum".fields); |
| 58 | 59 | } |
| 59 | 60 | |