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

Re: [PATCH v2] string.c: remove use of strcat() after strlen()



On Sat, Dec 30, 2023 at 9:10 PM James <tirtajames45@xxxxxxxxx> wrote:
>
> Since we are already calling strlen() beforehand to know the size of allocation, we can just memcpy()

Fair enough, but the function you've optimized is called so seldom
that this is not going to have a meaningful effect on performance.

> I'm using a MEMPCPY macro because I don't know how zsh handles using GNU/POSIX extensions.

Please explain why that matters?  The macro is used exactly once after
being declared and there are no preprocesor conditionals around it.




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