authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-15 23:07:01-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-18 19:02:06-07:00
log45a8c6c1f4efae49effdcecd541572872fa69582
tree74fc67943c1e224b0f363d8d19a7f7a7ab807bd0
parent6754d1a1826615886b933a7de207d1d97720ae53

AstGen: idiomatic use of switch


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

src/AstGen.zig+4-1
...@@ -12095,7 +12095,10 @@ const GenZir = struct {...@@ -12095,7 +12095,10 @@ const GenZir = struct {
12095 return gz.addAsIndex(.{12095 return gz.addAsIndex(.{
12096 .tag = .save_err_ret_index,12096 .tag = .save_err_ret_index,
12097 .data = .{ .save_err_ret_index = .{12097 .data = .{ .save_err_ret_index = .{
12098 .operand = if (cond == .if_of_error_type) cond.if_of_error_type else .none,12098 .operand = switch (cond) {
12099 .if_of_error_type => |x| x,
12100 else => .none,
12101 },
12099 } },12102 } },
12100 });12103 });
12101 }12104 }