mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
CBE: use a 0 literal instead of error.@"(no error)"
This saves bytes and is easier to read too.
This commit is contained in:
parent
af4361f57a
commit
d171279d79
@ -1141,8 +1141,10 @@ pub const DeclGen = struct {
|
||||
|
||||
if (!payload_ty.hasRuntimeBits()) {
|
||||
// We use the error type directly as the type.
|
||||
const err_val = if (val.errorUnionIsPayload()) Value.initTag(.zero) else val;
|
||||
return dg.renderValue(writer, error_ty, err_val, location);
|
||||
if (val.errorUnionIsPayload()) {
|
||||
return try writer.writeByte('0');
|
||||
}
|
||||
return dg.renderValue(writer, error_ty, val, location);
|
||||
}
|
||||
|
||||
if (location != .Initializer) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user