From 90fadb50df34d11348ec67a1cbbaeac8a28c2da3 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 8 Mar 2022 17:37:29 +0100 Subject: [Ada] Improve building of untagged equality When checking components of a record type for their own user-defined equality function it is enough to find just one such a component. Cleanup related to handling of user-defined equality in GNATprove. gcc/ada/ * exp_ch3.adb (Build_Untagged_Equality): Exit early when the outcome of a loop is already known. --- gcc/ada/exp_ch3.adb | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc') diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 018f88b..dfbbc62 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -4541,6 +4541,7 @@ package body Exp_Ch3 is and then Present (User_Defined_Eq (Etype (Comp))) then Build_Eq := True; + exit; end if; Next_Component (Comp); -- cgit v1.1