public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2076] [Ada] Simplify code by removing local constant
@ 2021-07-06 14:50 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-07-06 14:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:435e79cbe51e8f7e587b9dc7da794e82fba55932

commit r12-2076-g435e79cbe51e8f7e587b9dc7da794e82fba55932
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Tue May 11 16:53:36 2021 +0200

    [Ada] Simplify code by removing local constant
    
    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.

Diff:
---
 gcc/ada/uname.adb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gcc/ada/uname.adb b/gcc/ada/uname.adb
index 3192c3da6d2..5dc8ac6d5f3 100644
--- a/gcc/ada/uname.adb
+++ b/gcc/ada/uname.adb
@@ -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


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

only message in thread, other threads:[~2021-07-06 14:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 14:50 [gcc r12-2076] [Ada] Simplify code by removing local constant Pierre-Marie de Rodat

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).