diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-12-10 13:12:22 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-04-28 05:38:16 -0400 |
commit | 33d1be873954bc387387c2f9462fa0139157a182 (patch) | |
tree | 8fed497b82dae6aa6f82e6cd076d4d3d51a325ff | |
parent | bed6154a5a64235fb196e9d6007a4382481e426e (diff) | |
download | gcc-33d1be873954bc387387c2f9462fa0139157a182.zip gcc-33d1be873954bc387387c2f9462fa0139157a182.tar.gz gcc-33d1be873954bc387387c2f9462fa0139157a182.tar.bz2 |
[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.
-rw-r--r-- | gcc/ada/inline.adb | 9 |
1 files 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; |