On Sun, 31 Oct 2021 17:28:55 -0500, Scott Cheloha wrote:

> In tr(1), if we have already generated a given character class we
> don't need to do it again.

OK.

> Further, we don't need to keep all the memory we allocate for the set
> of characters in the class. NCHARS + 1 is just an upper bound on the
> length.  We should return whatever we don't need.

I suppose this is OK.  For the common case, returning the memory
is pointless since tr is short-lived and the number of classes used
is small.  The extra realloc should be fairly cheap, though.

 - todd

Reply via email to