bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/6] style: reduce scopes


From: Akim Demaille
Subject: [PATCH 5/6] style: reduce scopes
Date: Sat, 2 Feb 2019 18:13:06 +0100

* src/symlist.c (symbol_list_free): New.
---
 src/symlist.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/symlist.c b/src/symlist.c
index c5947cc8..d90946e7 100644
--- a/src/symlist.c
+++ b/src/symlist.c
@@ -148,14 +148,13 @@ symbol_list_append (symbol_list *list, symbol_list *node)
 void
 symbol_list_free (symbol_list *list)
 {
-  symbol_list *node, *next;
-  for (node = list; node; node = next)
+  for (symbol_list *next; list; list = next)
     {
-      next = node->next;
-      named_ref_free (node->named_ref);
-      if (node->content_type == SYMLIST_TYPE)
-        free (node->content.sem_type);
-      free (node);
+      next = list->next;
+      named_ref_free (list->named_ref);
+      if (list->content_type == SYMLIST_TYPE)
+        free (list->content.sem_type);
+      free (list);
     }
 }
 
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]