diff mbox series

[COMMITTED,03/30] ada: Remove unnecessary guard against empty list

Message ID 20240610090747.1557638-3-poulhies@adacore.com
State New
Headers show
Series [COMMITTED,01/30] ada: Refactor checks for Refined_Global in generic instances | expand

Commit Message

Marc Poulhiès June 10, 2024, 9:07 a.m. UTC
From: Piotr Trojanek <trojanek@adacore.com>

Code cleanup; semantics is unaffected.

gcc/ada/

	* sem_prag.adb (Report_Extra_Clauses): Remove redundant check
	for empty list, because First works also for No_List.

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

---
 gcc/ada/sem_prag.adb | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 29f27652138..9ccf1b9cf65 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -28248,16 +28248,13 @@  package body Sem_Prag is
          Clause : Node_Id;
 
       begin
-         if Present (Clauses) then
-            Clause := First (Clauses);
-            while Present (Clause) loop
-               SPARK_Msg_N
-                 ("unmatched or extra clause in dependence refinement",
-                  Clause);
+         Clause := First (Clauses);
+         while Present (Clause) loop
+            SPARK_Msg_N
+              ("unmatched or extra clause in dependence refinement", Clause);
 
-               Next (Clause);
-            end loop;
-         end if;
+            Next (Clause);
+         end loop;
       end Report_Extra_Clauses;
 
       --  Local variables