From edc6e791f807805e8d8ce3f4e929c09063195b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20S=C3=A9chet?= Date: Wed, 31 May 2023 16:46:10 +0000 Subject: [PATCH] Remove several isntance of the if/return/else pattern in caster.d --- src/d/semantic/caster.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d/semantic/caster.d b/src/d/semantic/caster.d index 16c4d5626..9e1769ad3 100644 --- a/src/d/semantic/caster.d +++ b/src/d/semantic/caster.d @@ -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); }