Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: remove duplicate array values in parameter expansion



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