1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

39943: no need to compute arrlen() in arrdup_max() when max == 0.

This commit is contained in:
Barton E. Schaefer 2016-11-14 14:44:57 -08:00
parent 921b39ac6b
commit 98b7960c78
2 changed files with 8 additions and 2 deletions

View file

@ -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)