Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: remove duplicate array values in parameter expansion
- X-seq: zsh-workers 16347
- From: Zefram <zefram@xxxxxxxx>
- To: Clint Adams <clint@xxxxxxx>
- Subject: Re: PATCH: remove duplicate array values in parameter expansion
- Date: Sun, 16 Dec 2001 22:58:52 +0000
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <20011216205032.GA32057@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20011214215105.GA24236@xxxxxxxx> <011214141539.ZM32471@xxxxxxxxxxxxxxxxxxxxxxx> <20011216205032.GA32057@xxxxxxxx>
Clint Adams wrote:
>+ while (*++p)
>+ for (t = x; t < p; t++)
>+ if (!strcmp(*p, *t)) {
>+ *p = NULL;
>+ for (t = p--; (*t = t[1]) != NULL; t++);
>+ break;
>+ }
"*p = NULL" is redundant (*p gets overwritten immediately).
>+ if (unique) {
>+/* if(!copied) */
>+ aval = arrdup(aval);
Is the commented-out code supposed to be there or not?
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author