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>
This commit is contained in:
Bo Yang
2010-05-06 21:52:27 -07:00
committed by Junio C Hamano
parent 3bf7886705
commit 9ca5df9061
5 changed files with 14 additions and 16 deletions

View File

@ -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];