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

Re: [PATCH] [merge-tracking] Code clarity fix

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-08-30 21:09:52 CEST

Daniel Berlin wrote:
>>
>>
>> Index: subversion/libsvn_subr/mergeinfo.c
>> ===================================================================
>> --- subversion/libsvn_subr/mergeinfo.c (revision 21302)
>> +++ subversion/libsvn_subr/mergeinfo.c (working copy)
>> @@ -76,15 +76,13 @@
>> else if (in1->start >= in2->start
>> && in1->end <= in2->end)
>> {
>> - (*output)->start = in2->start;
>> - (*output)->end = in2->end;
>> + *(*output) = *in2;
>> return TRUE;
>> }
>> else if (in2->start >= in1->start
>> && in2->end <= in1->end)
>> {
>> - (*output)->start = in1->start;
>> - (*output)->end = in1->end;
>> + *(*output) = *in1;
>> return TRUE;
>> }
>
> I actually believe this makes the code much less clear (it's also not
> faster, since the compiler will transform it back into a block copy if
> it makes sense).
>
I am not sure about the speed.
I thought copying 8 bytes at one shot should be faster than dereferncing
4 integer items and assigning them.
If I understand this segment of code it just takes the 'forward merge
ranges', which this '*(*output) = *in1; ' should be more meaningful with
the associated commit message.

I have some other clarity points to make in the same code for which the
patch follows.

With regards
Kamesh Jayachandran

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 30 21:42:33 2006

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.