From: Piotr Trojanek Date: Mon, 8 Jun 2020 12:33:08 +0000 (+0200) Subject: [Ada] Simplify detection of others choice with just one value X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfcc473d9901c0bded1c106f271a82a9bd9063fe;p=thirdparty%2Fgcc.git [Ada] Simplify detection of others choice with just one value gcc/ada/ * sem_case.adb (Build_Choice): Simplify. --- diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index 5bb94e26ea68..953619c91e43 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -1012,7 +1012,7 @@ package body Sem_Case is -- If there is only one choice value missing between Value1 and -- Value2, build an integer or enumeration literal to represent it. - if (Value2 - Value1) = 0 then + if Value1 = Value2 then if Is_Integer_Type (Choice_Type) then Lit_Node := Make_Integer_Literal (Loc, Value1); Set_Etype (Lit_Node, Choice_Type);