mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
use block break instead of return
This commit is contained in:
parent
ae00a2a84d
commit
4314c9653a
1 changed files with 2 additions and 4 deletions
|
|
@ -137,7 +137,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
|
|||
}
|
||||
},
|
||||
|
||||
.@"union" => |info| {
|
||||
.@"union" => |info| blk: {
|
||||
if (info.tag_type) |tag_type| {
|
||||
const tag = std.meta.activeTag(key);
|
||||
hash(hasher, tag, strat);
|
||||
|
|
@ -146,9 +146,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
|
|||
if (field.type != void) {
|
||||
hash(hasher, @field(key, field.name), strat);
|
||||
}
|
||||
// TODO use a labelled break when it does not crash the compiler. cf #2908
|
||||
// break :blk;
|
||||
return;
|
||||
break :blk;
|
||||
}
|
||||
}
|
||||
unreachable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue