mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
AstGen: idiomatic use of switch
This commit is contained in:
parent
6754d1a182
commit
45a8c6c1f4
@ -12095,7 +12095,10 @@ const GenZir = struct {
|
||||
return gz.addAsIndex(.{
|
||||
.tag = .save_err_ret_index,
|
||||
.data = .{ .save_err_ret_index = .{
|
||||
.operand = if (cond == .if_of_error_type) cond.if_of_error_type else .none,
|
||||
.operand = switch (cond) {
|
||||
.if_of_error_type => |x| x,
|
||||
else => .none,
|
||||
},
|
||||
} },
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user