authorgravatar for marko03kostic@protonmail.commarko <marko03kostic@protonmail.com> 2025-09-17 14:33:40+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-17 19:45:33-07:00
log4314c9653a874451d1c9b3dbb8be08d966344028
treec447d725c34ae89182291e9a42cd7295028342c0
parentae00a2a84d34417c1fb6229db5919abcdced0ea0

use block break instead of return


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

lib/std/hash/auto_hash.zig+2-4
...@@ -137,7 +137,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {...@@ -137,7 +137,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
137 }137 }
138 },138 },
139139
140 .@"union" => |info| {140 .@"union" => |info| blk: {
141 if (info.tag_type) |tag_type| {141 if (info.tag_type) |tag_type| {
142 const tag = std.meta.activeTag(key);142 const tag = std.meta.activeTag(key);
143 hash(hasher, tag, strat);143 hash(hasher, tag, strat);
...@@ -146,9 +146,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {...@@ -146,9 +146,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
146 if (field.type != void) {146 if (field.type != void) {
147 hash(hasher, @field(key, field.name), strat);147 hash(hasher, @field(key, field.name), strat);
148 }148 }
149 // TODO use a labelled break when it does not crash the compiler. cf #2908149 break :blk;
150 // break :blk;
151 return;
152 }150 }
153 }151 }
154 unreachable;152 unreachable;