From 7d4b41b52aeabb6f6f95f9bdfdab96b5fd66909a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 23 Sep 2017 19:23:53 +0100 Subject: 41747: Don't create hash entry if just checking existence. Pass a flag in indicating this case. --- Src/subst.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Src/subst.c') diff --git a/Src/subst.c b/Src/subst.c index 357dc9168..55b5444c6 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2446,7 +2446,13 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, */ if (!subexp || aspar) { char *ov = val; - + int scanflags = hkeys | hvals; + if (arrasg) + scanflags |= SCANPM_ASSIGNING; + if (qt) + scanflags |= SCANPM_DQUOTED; + if (chkset) + scanflags |= SCANPM_CHECKING; /* * Second argument: decide whether to use the subexpression or * the string next on the line as the parameter name. @@ -2475,9 +2481,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (!(v = fetchvalue(&vbuf, (subexp ? &ov : &s), (wantt ? -1 : ((unset(KSHARRAYS) || inbrace) ? 1 : -1)), - hkeys|hvals| - (arrasg ? SCANPM_ASSIGNING : 0)| - (qt ? SCANPM_DQUOTED : 0))) || + scanflags)) || (v->pm && (v->pm->node.flags & PM_UNSET)) || (v->flags & VALFLAG_EMPTY)) vunset = 1; -- cgit 1.4.1