You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kamesh Jayachandran <ka...@collab.net> on 2006/07/09 17:52:15 UTC
[PATCH] [merge-tracking]clarity fix for subversion/libsvn_subr/mergeinfo.c
Hi All,
Find the attached patch.
With regards
Kamesh Jayachandran
[[[
Patch by: Kamesh Jayachandran <ka...@collab.net>
Code clarity fix.
* subversion/libsvn_subr/mergeinfo.c
(rangelist_intersect_or_remove):
If elt2 and elt1 intersect(Not 'contains'(As 'contains' is a special case
of 'intersect')), 'elt1->start < elt2->start' and '(elt1->end >
elt2->end)'
are mutually exclusive conditions which can be represented as 'if...else'
block rather than subsequent 'if...if' block.
]]]
Re: [PATCH] [merge-tracking]clarity fix for subversion/libsvn_subr/mergeinfo.c
Posted by Kamesh Jayachandran <ka...@collab.net>.
Daniel Berlin wrote:
> So, for the code that's there, this is wrong.
>
> Given:
>
> elt1 == 5, 9
> elt2 == 6, 8
>
>
Very good example. Myself stand corrected.
With regards
Kamesh Jayachandran
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] [merge-tracking]clarity fix for subversion/libsvn_subr/mergeinfo.c
Posted by Daniel Berlin <db...@dberlin.org>.
Kamesh Jayachandran wrote:
> Hi All,
> Find the attached patch.
>
> With regards
> Kamesh Jayachandran
>
> [[[
> Patch by: Kamesh Jayachandran <ka...@collab.net>
>
> Code clarity fix.
>
> * subversion/libsvn_subr/mergeinfo.c
> (rangelist_intersect_or_remove):
> If elt2 and elt1 intersect(Not 'contains'(As 'contains' is a special case
> of 'intersect')), 'elt1->start < elt2->start' and '(elt1->end >
> elt2->end)'
> are mutually exclusive conditions which can be represented as 'if...else'
> block rather than subsequent 'if...if' block.
So, for the code that's there, this is wrong.
Given:
elt1 == 5, 9
elt2 == 6, 8
These intersect, and we have elt1->start < elt2->start && elt1->end >
elt2->end.
So they aren't mutually exclusive conditions.
However, we only check whether elt2 contains elt1 (search for
range_contains), not the other way around, so this patch would change
the semantics in the case that range_contains (elt1, elt2), like above.
--Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org