On Wed, Dec 18, 2013 at 10:22:26PM +0100, Bert Huijben wrote:
> Can you explain why you changed this?
>
> This changes one bit of dynamic calculation to another bit of dynamic calculation while this string is completely constant. You now use the compiler to optimize away a strlen, but apr_snprintf() has a lot more overhead in other places (variable arguments, parsing the format string, etc.).
>
> In this case I'm really wondering why we change working code...?
>
> Bert
>
I just think we shouldn't use strcpy() anywhere. It's always a
red flag for me when reading code. In this case it does no harm,
of course, but I still think code using strcpy() is generally
bad style. The function should be phased out of general use.
Feel free to revert this if the alleged performance overhead
in the logging subsystem of svnserve concerns you more than my
peace of mind that we don't use strcpy() in our core code (all
other instances I found where in tests or generated bindings code
where I don't care as much but wouldn't mind seeing them eradicated
either).
Received on 2013-12-19 01:20:27 CET