]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Simplify detection of alphabetic characters with membership test
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 2 Dec 2021 14:44:57 +0000 (15:44 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 Jan 2022 11:32:38 +0000 (11:32 +0000)
gcc/ada/

* sem_prag.adb (Adjust_External_Name_Case): Use membership test.

gcc/ada/sem_prag.adb

index 40c4db40abd62f137a217ba38aadb0572b98362b..ce2b2ef1962665c1e057a960c32d911c59af53bf 100644 (file)
@@ -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);