]> git.neil.brown.name Git - wiggle.git/commitdiff
Remove duplicate definition of "csl_join"
authorNeilBrown <neilb@suse.de>
Fri, 1 Mar 2013 05:52:10 +0000 (16:52 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 1 Mar 2013 05:52:10 +0000 (16:52 +1100)
We really only need one of these.

Signed-off-by: NeilBrown <neilb@suse.de>
bestmatch.c
wiggle.h

index 578dc0bc956f6298e032a704a57e643bc11adb01..988a211978c4d684ecf666f07986ee9da2aba96f 100644 (file)
@@ -271,35 +271,6 @@ static void find_best(struct file *a, struct file *b,
        free(valloc);
 }
 
-/* Join two csl lists together.
- * Simply allocate new space and copy everything in.
- */
-static struct csl *csl_join(struct csl *c1, struct csl *c2)
-{
-       struct csl *c, *cd,  *rv;
-       int cnt;
-
-       if (c1 == NULL)
-               return c2;
-       if (c2 == NULL)
-               return c1;
-
-       cnt = 1; /* the sentinal */
-       for (c = c1; c->len; c++)
-               cnt++;
-       for (c = c2; c->len; c++)
-               cnt++;
-       cd = rv = xmalloc(sizeof(*rv)*cnt);
-       for (c = c1; c->len; c++)
-               *cd++ = *c;
-       for (c = c2; c->len; c++)
-               *cd++ = *c;
-       cd->len = 0;
-       free(c1);
-       free(c2);
-       return rv;
-}
-
 /*
  * Reduce a file by discarding less interesting words
  * Words that end with a newline are interesting (so all words
index 6541a27a86d16247e05634939a9a2c8f06d02ce9..89610cd2b1956e541415eecc10afc692ea66c8b1 100644 (file)
--- a/wiggle.h
+++ b/wiggle.h
@@ -163,6 +163,7 @@ extern struct csl *diff_partial(struct file a, struct file b,
                                int alo, int ahi, int blo, int bhi);
 extern struct csl *worddiff(struct stream f1, struct stream f2,
                            struct file *fl1p, struct file *fl2p);
+extern struct csl *csl_join(struct csl *c1, struct csl *c2);
 
 struct ci {
        int conflicts, wiggles, ignored;