]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Simplify code by removing local constant
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 11 May 2021 14:53:36 +0000 (16:53 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 6 Jul 2021 14:46:58 +0000 (14:46 +0000)
gcc/ada/

* uname.adb (Add_Node_Name): Replace local constant whose
initial expression was evaluated even when unnecessary with just
that expression that is evaluated at most once and only when
needed.

gcc/ada/uname.adb

index 3192c3da6d2a92e7fd2087599b6f2e9b160c657d..5dc8ac6d5f32c9e210fd6bdf5c167d4491edf992 100644 (file)
@@ -223,8 +223,6 @@ package body Uname is
       -------------------
 
       procedure Add_Node_Name (Node : Node_Id) is
-         Kind : constant Node_Kind := Nkind (Node);
-
       begin
          --  Just ignore an error node (someone else will give a message)
 
@@ -234,7 +232,7 @@ package body Uname is
          --  Otherwise see what kind of node we have
 
          else
-            case Kind is
+            case Nkind (Node) is
                when N_Defining_Identifier
                   | N_Defining_Operator_Symbol
                   | N_Identifier