From 172d4be4d5955c6a963663da46f9a88c49c00cc2 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 8 Aug 2020 06:26:21 +0200 Subject: 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 --- evaluate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/evaluate.c b/evaluate.c index 8d09c560..d2cf1c0a 100644 --- a/evaluate.c +++ b/evaluate.c @@ -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; } -- cgit 1.2.3-korg