]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Simplify lookup of predecessor in homonym chain
authorRonan Desplanques <desplanques@adacore.com>
Tue, 10 Jan 2023 12:49:50 +0000 (13:49 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 15 May 2023 09:36:42 +0000 (11:36 +0200)
gcc/ada/

* sem_ch8.adb (End_Scope): Simplify lookup of predecessor in
homonym chain.

gcc/ada/sem_ch8.adb

index 6f858eea0f998b4d4fba7da57e066a1fb1671210..e4b3519bbaa799cbc925f77da6b1f0f3a13e8d84 100644 (file)
@@ -5066,7 +5066,6 @@ package body Sem_Ch8 is
          if Id /= Current_Entity (Id) then
             Prev := Current_Entity (Id);
             while Present (Prev)
-              and then Present (Homonym (Prev))
               and then Homonym (Prev) /= Id
             loop
                Prev := Homonym (Prev);
@@ -5074,7 +5073,7 @@ package body Sem_Ch8 is
 
             --  Skip to end of loop if Id is not in the visibility chain
 
-            if No (Prev) or else Homonym (Prev) /= Id then
+            if No (Prev) then
                goto Next_Ent;
             end if;