summaryrefslogtreecommitdiff
path: root/diffcore-break.c
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2010-05-06 21:52:27 -0700
committerJunio C Hamano <gitster@pobox.com>2010-05-07 09:34:27 -0700
commit9ca5df90615aa3c6b60e1bc8f03db6cae98e816c (patch)
tree807f76999f2c9a7aca03d7b308ae8e36bdfd5658 /diffcore-break.c
parent3bf7886705b4ea7189f046fa5258fdf6edcdbe23 (diff)
downloadgit-9ca5df90615aa3c6b60e1bc8f03db6cae98e816c.tar.gz
Add a macro DIFF_QUEUE_CLEAR.
Refactor the diff_queue_struct code, this macro help to reset the structure. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-break.c')
-rw-r--r--diffcore-break.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index 3a7b60a037..44f8678d22 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -162,8 +162,7 @@ void diffcore_break(int break_score)
if (!merge_score)
merge_score = DEFAULT_MERGE_SCORE;
- outq.nr = outq.alloc = 0;
- outq.queue = NULL;
+ DIFF_QUEUE_CLEAR(&outq);
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
@@ -256,8 +255,7 @@ void diffcore_merge_broken(void)
struct diff_queue_struct outq;
int i, j;
- outq.nr = outq.alloc = 0;
- outq.queue = NULL;
+ DIFF_QUEUE_CLEAR(&outq);
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];