> I haven't been following the merge tracking stuff, but detecting
> overlapping ranges is notorious for being both tricky and simple: it's
> tricky to get the algorithm right, but the right algorithm is simple.
>
> static svn_boolean_t
> combine_ranges(svn_merge_range_t **output,
> svn_merge_range_t *in1,
> svn_merge_range_t *in2)
> {
> if (in1->start <= in2->end + 1 && in2->start <= in1->end + 1)
> {
> (*output)->start = MIN(in1->start, in2->start);
> (*output)->end = MAX(in1->end, in2->end);
> return TRUE;
> }
> else
> return FALSE;
> }
>
Yeah, this would work.
But you do realize a good compiler will optimize the longhand version
into this, right?
:)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 7 02:31:59 2006