diff options
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 5ba1e555a7..1b9af88bb1 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -14680,11 +14680,11 @@ fn resolvePeerTypes( instructions: []Air.Inst.Ref, candidate_srcs: Module.PeerTypeCandidateSrc, ) !Type { - if (instructions.len == 0) - return Type.initTag(.noreturn); - - if (instructions.len == 1) - return sema.typeOf(instructions[0]); + switch (instructions.len) { + 0 => return Type.initTag(.noreturn), + 1 => return sema.typeOf(instructions[0]), + else => {}, + } const target = sema.mod.getTarget(); @@ -14714,13 +14714,14 @@ fn resolvePeerTypes( continue; }, .Int => { - if (chosen_ty.isSignedInt() == candidate_ty.isSignedInt()) { - if (chosen_ty.intInfo(target).bits < candidate_ty.intInfo(target).bits) { - chosen = candidate; - chosen_i = candidate_i + 1; - } - continue; + const chosen_info = chosen_ty.intInfo(target); + const candidate_info = candidate_ty.intInfo(target); + + if (chosen_info.bits < candidate_info.bits) { + chosen = candidate; + chosen_i = candidate_i + 1; } + continue; }, .Pointer => if (chosen_ty.ptrSize() == .C) continue, else => {}, |
