Branko ÄŒibej wrote:
> Jesper Louis Andersen wrote:
>> The patch simply works by making i an apr_size_t, increasing it
>> and making the calculation str->len - i instead. Note that str->len
>> is loop invariant and str->len - i can be common subexpression
>> eliminated. Thus the performance drop should not be measureable.
>>
> Ah, but whilst "len - i" can be CSE'd, it cant' be avoided. You can
> avoid the slowdown by continuing to use a countdown loop but shifting
> the limits, thusly:
Good, but why are we writing this function out long-hand and not just calling
standard strrchr() and subtracting the start pointer from its result (if
non-null)? We can reasonably expect strrchr() to be implemented efficiently
for the platform on which it is running, and it may do better than our generic
version.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 14 18:05:14 2004