Skip to content

Commit

Permalink
Remove several isntance of the if/return/else pattern in caster.d
Browse files Browse the repository at this point in the history
  • Loading branch information
deadalnix committed May 31, 2023
1 parent aa64387 commit edc6e79
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/d/semantic/caster.d
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,16 @@ struct Caster(bool isExplicit, alias bailoutOverride = null) {
bt = unsigned(bt);
if (ut == bt) {
return CastKind.Bit;
} else if (ut < bt) {
}

if (ut < bt) {
return isSigned(t) ? CastKind.SPad : CastKind.UPad;
} else static if (isExplicit) {
}

static if (isExplicit) {
return CastKind.Trunc;
} else {
// This will trigger VRP.
return bailout(t);
}

Expand Down

0 comments on commit edc6e79

Please sign in to comment.