diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-12-02 15:44:57 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-05 11:32:38 +0000 |
commit | a7b4fbd9b4c2c24bac956125068d2540976bf90e (patch) | |
tree | db4e0819659b5a3bcaf58e52aa077eecabda56e3 /gcc | |
parent | 2af751b3b8db297e1cc78e3968ca1f714b75c4ea (diff) | |
download | gcc-a7b4fbd9b4c2c24bac956125068d2540976bf90e.zip gcc-a7b4fbd9b4c2c24bac956125068d2540976bf90e.tar.gz gcc-a7b4fbd9b4c2c24bac956125068d2540976bf90e.tar.bz2 |
[Ada] Simplify detection of alphabetic characters with membership test
gcc/ada/
* sem_prag.adb (Adjust_External_Name_Case): Use membership test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_prag.adb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 40c4db4..ce2b2ef 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); |