]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Don't examine all discriminants when looking for the first one
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 23 Jun 2021 08:17:24 +0000 (10:17 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 20 Sep 2021 12:31:30 +0000 (12:31 +0000)
gcc/ada/

* sem_ch3.adb (Build_Discriminant_Constraints): Exit once a
first discriminant is found and the Discrim_Present flag is set.

gcc/ada/sem_ch3.adb

index e9b445619ea1794353c7a1f85ce33ceb1a418f79..dbcb0babb5d7ed52bf2735d28f782a166e985b65 100644 (file)
@@ -10392,6 +10392,7 @@ package body Sem_Ch3 is
               (Discr_Expr (J), Check_Concurrent => True)
          then
             Discrim_Present := True;
+            exit;
          end if;
       end loop;