diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2016-11-14 14:44:57 -0800 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2016-11-15 10:04:14 -0800 |
commit | 98b7960c78ef720c3d830bef2258f6aa86c055de (patch) | |
tree | cddab57633ba88681785aeff0afbbb2a2dd6d306 /Src | |
parent | 921b39ac6b25dbfcc477fc7db4ed1c5c3ffb778c (diff) | |
download | zsh-98b7960c78ef720c3d830bef2258f6aa86c055de.tar.gz zsh-98b7960c78ef720c3d830bef2258f6aa86c055de.tar.xz zsh-98b7960c78ef720c3d830bef2258f6aa86c055de.zip |
39943: no need to compute arrlen() in arrdup_max() when max == 0.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/utils.c b/Src/utils.c index 92d831172..151e9e4eb 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -4252,9 +4252,10 @@ mod_export char ** arrdup_max(char **s, unsigned max) { char **x, **y, **send; - int len; + int len = 0; - len = arrlen(s); + if (max) + len = arrlen(s); /* Limit has sense only if not equal to len */ if (max > len) |