From 33d1be873954bc387387c2f9462fa0139157a182 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 10 Dec 2020 13:12:22 +0100 Subject: [PATCH] [Ada] Remove redundant assignment in Formal_Is_Used_Once gcc/ada/ * inline.adb (Formal_Is_Used_Once): Refine type of the counter variable; remove redundant assignment. --- gcc/ada/inline.adb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index f373e89..16c4cd7 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2827,7 +2827,7 @@ package body Inline is ------------------------- function Formal_Is_Used_Once (Formal : Entity_Id) return Boolean is - Use_Counter : Int := 0; + Use_Counter : Nat := 0; function Count_Uses (N : Node_Id) return Traverse_Result; -- Traverse the tree and count the uses of the formal parameter. @@ -2856,13 +2856,10 @@ package body Inline is then Use_Counter := Use_Counter + 1; - if Use_Counter > 1 then - - -- Denote more than one use and abandon the traversal + -- If this is a second use then abandon the traversal - Use_Counter := 2; + if Use_Counter > 1 then return Abandon; - end if; end if; -- 2.7.4