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

[PATCH] removing unexercised code from merge-tracking/subversion/libsvn_subr/mergeinfo.c

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-07-03 13:37:58 CEST

Hi All,
Find the attached patch.

With regards
Kamesh Jayachandran

[[[
Patch by: Kamesh Jayachandran <kamesh@collab.net>

Removing unexcercised code.

* subversion/libsvn_subr/mergeinfo.c
  (svn_rangelist_remove):
    'if (elt1->start == elt2->start && elt1->end == elt2->end)' is taken
    care by range_contains and will never be exercised in the
    range_intersect block.
]]]

Index: subversion/libsvn_subr/mergeinfo.c
===================================================================
--- subversion/libsvn_subr/mergeinfo.c (revision 20359)
+++ subversion/libsvn_subr/mergeinfo.c (working copy)
@@ -447,43 +447,34 @@
         }
       else if (range_intersect(elt2, elt1))
         {
- /* If they match exactly, we just move on. */
- if (elt1->start == elt2->start && elt1->end == elt2->end)
- {
- i++;
- j++;
- }
- else
- {
- svn_merge_range_t temprange;
- /* If the whiteboard range starts before the eraser
- range, we need to output the range that falls before
- the eraser start. */
+ svn_merge_range_t temprange;
+ /* If the whiteboard range starts before the eraser
+ range, we need to output the range that falls before
+ the eraser start. */
 
- if (elt1->start < elt2->start)
+ if (elt1->start < elt2->start)
+ {
+ temprange.start = elt1->start;
+ temprange.end = elt2->start - 1;
+ if (!lastrange || !svn_combine_ranges(&lastrange, lastrange,
+ &temprange))
                 {
- temprange.start = elt1->start;
- temprange.end = elt2->start - 1;
- if (!lastrange || !svn_combine_ranges(&lastrange, lastrange,
- &temprange))
- {
- newrange = svn_range_dup(&temprange, pool);
- APR_ARRAY_PUSH(*output, svn_merge_range_t *) = newrange;
- lastrange = newrange;
- }
+ newrange = svn_range_dup(&temprange, pool);
+ APR_ARRAY_PUSH(*output, svn_merge_range_t *) = newrange;
+ lastrange = newrange;
                 }
- /* Set up the rest of the whiteboard range for further
- processing. */
- if (elt1->end > elt2->end)
- {
- wboardelt.start = elt2->end + 1;
- wboardelt.end = elt1->end;
- }
- else
- {
- i++;
- }
             }
+ /* Set up the rest of the whiteboard range for further
+ processing. */
+ if (elt1->end > elt2->end)
+ {
+ wboardelt.start = elt2->end + 1;
+ wboardelt.end = elt1->end;
+ }
+ else
+ {
+ i++;
+ }
         }
       else
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 3 13:37:58 2006

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