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

Re: [PATCH] Optimization of getarrvalue()



On Nov 14,  1:57pm, Peter Stephenson wrote:
}
} If we can agree your patch is OK as far as it goes I'll have a look and
} see if I can understand those failures with that additional change.

The original code structure was

    if (A)
      a;
    else
      x;
    if (B)
      b;
    else if (C)
      c;

This changed to

    if (A)
      a;
    else if (B)
      b;
    else
      c and x;

This means that in the new structure, b never happens when A.  In the
old code we might allocate the array ('') and then truncate to (), but
in the new code we allocate ('') and then do nothing.

This stems I think from misunderstanding that "nular" is an array of one
nul string, not an empty array.

Jun's change makes this

    if (B)
      b;
    else if (A)
      a;
    else
      c and x;

which looks correct to me because b results in an empty array in either
the original structure or the new one.



Messages sorted by: Reverse Date, Date, Thread, Author