[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Simplification/speed-up of libsvn_diff by eliminating idx

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Fri, 27 May 2011 16:10:12 +0200

On Fri, May 27, 2011 at 3:13 PM, Julian Foad <julian.foad_at_wandisco.com> wrote:
> On Fri, 2011-05-27 at 13:32 +0200, Johan Corveleyn wrote:

[snip]

>> Maybe some of the performance improvement (and simplification) can be
>> achieved simply by calculating idx0 and idx1 once, and then reusing
>> those variables and pass them on:
>>
>>     idx0 = length[0] > length[1] ? 1 : 0;
>>     idx1 = abs(1 - idx0);
>>
>> instead of re-calculating abs(1 - idx) everywhere.
>
> Why does it use "abs()", I wonder?  That looks redundant if idx can only
> be 0 or 1.

Ah yes, of course. Doh! Why indeed.

-- 
Johan
Received on 2011-05-27 16:11:11 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.