[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] * runtime.c (C_delete_symbol_table): Remove de
From: |
megane |
Subject: |
[Chicken-hackers] [PATCH] * runtime.c (C_delete_symbol_table): Remove dead code |
Date: |
Mon, 01 Apr 2019 15:49:11 +0300 |
User-agent: |
mu4e 1.0; emacs 25.1.1 |
Hi!
Here's a small one.
>From b0bd69d84ca7825a23a878160b65e0fa29c2e18c Mon Sep 17 00:00:00 2001
From: megane <address@hidden>
Date: Sun, 24 Mar 2019 10:22:08 +0200
Subject: [PATCH] * runtime.c (C_delete_symbol_table): Remove dead code
Variable prev is never assigned to. Therefore only the false branch is
ever executed.
---
runtime.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/runtime.c b/runtime.c
index 75cc8d4..76ef599 100644
--- a/runtime.c
+++ b/runtime.c
@@ -1053,13 +1053,11 @@ C_regparm C_SYMBOL_TABLE *C_new_symbol_table(char
*name, unsigned int size)
C_regparm void C_delete_symbol_table(C_SYMBOL_TABLE *st)
{
- C_SYMBOL_TABLE *stp, *prev = NULL;
+ C_SYMBOL_TABLE *stp;
for(stp = symbol_table_list; stp != NULL; stp = stp->next)
if(stp == st) {
- if(prev != NULL) prev->next = stp->next;
- else symbol_table_list = stp->next;
-
+ symbol_table_list = stp->next;
return;
}
}
--
2.7.4
- [Chicken-hackers] [PATCH] * runtime.c (C_delete_symbol_table): Remove dead code,
megane <=