From: Piotr Trojanek Date: Thu, 2 Dec 2021 14:44:57 +0000 (+0100) Subject: [Ada] Simplify detection of alphabetic characters with membership test X-Git-Tag: basepoints/gcc-13~2062 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7b4fbd9b4c2c24bac956125068d2540976bf90e;p=thirdparty%2Fgcc.git [Ada] Simplify detection of alphabetic characters with membership test gcc/ada/ * sem_prag.adb (Adjust_External_Name_Case): Use membership test. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 40c4db40abd6..ce2b2ef19626 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -398,14 +398,12 @@ package body Sem_Prag is CC := Get_String_Char (Strval (N), J); if Opt.External_Name_Exp_Casing = Uppercase - and then CC >= Get_Char_Code ('a') - and then CC <= Get_Char_Code ('z') + and then CC in Get_Char_Code ('a') .. Get_Char_Code ('z') then Store_String_Char (CC - 32); elsif Opt.External_Name_Exp_Casing = Lowercase - and then CC >= Get_Char_Code ('A') - and then CC <= Get_Char_Code ('Z') + and then CC in Get_Char_Code ('A') .. Get_Char_Code ('Z') then Store_String_Char (CC + 32);