authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-05-26 23:26:19-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-05-26 23:26:19-07:00
log3cac0a5614500ad90fbc3913ae4dc6aa56f2d595
tree02b331e499e569f2a9d68ffcd228fd22ef9fe740
parentb683498ae8065ba820700944b4417e8d2174d068

Not sure how a tab snuck in there


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

lib/std/meta.zig+2-2
...@@ -55,7 +55,7 @@ test "std.meta.tagName" {...@@ -55,7 +55,7 @@ test "std.meta.tagName" {
55pub fn stringToEnum(comptime T: type, str: []const u8) ?T {55pub fn stringToEnum(comptime T: type, str: []const u8) ?T {
56 // Using ComptimeStringMap here is more performant, but it will start to take too56 // Using ComptimeStringMap here is more performant, but it will start to take too
57 // long to compile if the enum is large enough, due to the current limits of comptime57 // long to compile if the enum is large enough, due to the current limits of comptime
58 // performance when doing things like constructing lookup maps at comptime.58 // performance when doing things like constructing lookup maps at comptime.
59 // TODO The '100' here is arbitrary and should be increased when possible:59 // TODO The '100' here is arbitrary and should be increased when possible:
60 // - https://github.com/ziglang/zig/issues/405560 // - https://github.com/ziglang/zig/issues/4055
61 // - https://github.com/ziglang/zig/issues/386361 // - https://github.com/ziglang/zig/issues/3863
...@@ -70,7 +70,7 @@ pub fn stringToEnum(comptime T: type, str: []const u8) ?T {...@@ -70,7 +70,7 @@ pub fn stringToEnum(comptime T: type, str: []const u8) ?T {
70 };70 };
71 var kvs_array: [@typeInfo(T).Enum.fields.len]EnumKV = undefined;71 var kvs_array: [@typeInfo(T).Enum.fields.len]EnumKV = undefined;
72 inline for (@typeInfo(T).Enum.fields) |enumField, i| {72 inline for (@typeInfo(T).Enum.fields) |enumField, i| {
73 kvs_array[i] = .{.@"0" = enumField.name, .@"1" = @field(T, enumField.name)};73 kvs_array[i] = .{ .@"0" = enumField.name, .@"1" = @field(T, enumField.name) };
74 }74 }
75 break :build_kvs kvs_array[0..];75 break :build_kvs kvs_array[0..];
76 };76 };