summaryrefslogtreecommitdiff
path: root/Src/parse.c
diff options
context:
space:
mode:
authorSebastian Gniazdowski <psprint@zdharma.org>2017-07-05 09:35:57 +0200
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-07-09 17:38:01 +0100
commitb31f947795fe9711d6094bbfc4675f60b8ffc746 (patch)
tree20c3d5dfabc067524feea5b410052cd6d81483d1 /Src/parse.c
parente556f9c78d0216c2a543035586bc3a7cd1918d73 (diff)
downloadzsh-b31f947795fe9711d6094bbfc4675f60b8ffc746.tar.gz
zsh-b31f947795fe9711d6094bbfc4675f60b8ffc746.zip
41402: Delay has_tokens() in ecstrcode as may not be needed
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/parse.c b/Src/parse.c
index 00a8f6a5a..ba9cd61eb 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -394,11 +394,12 @@ ecdel(int p)
static wordcode
ecstrcode(char *s)
{
- int l, t = has_token(s);
+ int l, t;
unsigned val = hasher(s);
if ((l = strlen(s) + 1) && l <= 4) {
+ t = has_token(s);
wordcode c = (t ? 3 : 2);
switch (l) {
case 4: c |= ((wordcode) STOUC(s[2])) << 19;
@@ -417,6 +418,9 @@ ecstrcode(char *s)
}
pp = (cmp < 0 ? &(p->left) : &(p->right));
}
+
+ t = has_token(s);
+
p = *pp = (Eccstr) zhalloc(sizeof(*p));
p->left = p->right = 0;
p->offs = ((ecsoffs - ecssub) << 2) | (t ? 1 : 0);