diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-08 06:26:21 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-08 15:36:51 +0200 |
commit | 172d4be4d5955c6a963663da46f9a88c49c00cc2 (patch) | |
tree | 393416a23ba0e93fb9b5b362a3046383de937e3a | |
parent | 446313222a0b47504d162a1e67527fb517275096 (diff) | |
download | sparse-172d4be4d5955c6a963663da46f9a88c49c00cc2.tar.gz |
wstring: call is_string_type() only when needed
Just a tiny code reorganization to call is_string_type()
only where & when needed.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | evaluate.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -2764,7 +2764,6 @@ static struct expression *handle_scalar(struct expression *e, int nested) static int handle_initializer(struct expression **ep, int nested, int class, struct symbol *ctype, unsigned long mods) { - int is_string = is_string_type(ctype); struct expression *e = *ep, *p; struct symbol *type; @@ -2798,7 +2797,7 @@ static int handle_initializer(struct expression **ep, int nested, * pathologies, so we don't need anything fancy here. */ if (e->type == EXPR_INITIALIZER) { - if (is_string) { + if (is_string_type(ctype)) { struct expression *v = NULL; int count = 0; @@ -2819,7 +2818,7 @@ static int handle_initializer(struct expression **ep, int nested, /* string */ if (is_string_literal(&e)) { /* either we are doing array of char, or we'll have to dig in */ - if (is_string) { + if (is_string_type(ctype)) { *ep = e; goto String; } |