From: Piotr Trojanek Date: Wed, 23 Jun 2021 08:17:24 +0000 (+0200) Subject: [Ada] Don't examine all discriminants when looking for the first one X-Git-Tag: basepoints/gcc-13~4618 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2743363047517c25a884fcf8e08a8108f1368fa6;p=thirdparty%2Fgcc.git [Ada] Don't examine all discriminants when looking for the first one gcc/ada/ * sem_ch3.adb (Build_Discriminant_Constraints): Exit once a first discriminant is found and the Discrim_Present flag is set. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e9b445619ea1..dbcb0babb5d7 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -10392,6 +10392,7 @@ package body Sem_Ch3 is (Discr_Expr (J), Check_Concurrent => True) then Discrim_Present := True; + exit; end if; end loop;