public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Remove duplicated code in Proc_Next_Component_Or_Discriminant
@ 2023-05-15  9:44 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-05-15  9:44 UTC (permalink / raw)
  To: gcc-patches; +Cc: Bob Duff

From: Bob Duff <duff@adacore.com>

Proc_Next_Component_Or_Discriminant was duplicating the code
in Next_Component_Or_Discriminant.

gcc/ada/

	* einfo-utils.adb:
	(Proc_Next_Component_Or_Discriminant): Call
	Next_Component_Or_Discriminant.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/einfo-utils.adb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index dc379cbc852..a8220e2d133 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -3219,11 +3219,7 @@ package body Einfo.Utils is
 
    procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id) is
    begin
-      N := Next_Entity (N);
-      while Present (N) loop
-         exit when Ekind (N) in E_Component | E_Discriminant;
-         N := Next_Entity (N);
-      end loop;
+      N := Next_Component_Or_Discriminant (N);
    end Proc_Next_Component_Or_Discriminant;
 
    procedure Proc_Next_Discriminant              (N : in out Node_Id) is
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-15  9:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15  9:44 [COMMITTED] ada: Remove duplicated code in Proc_Next_Component_Or_Discriminant Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).