From: Nguyễn Thái Ngọc Duy Date: Thu, 31 Dec 2015 12:37:31 GMT Subject: [PATCH 1/7] diff.c: keep all word diff structs together Message-ID: <1451565457-18756-2-git-send-email-pclouds@gmail.com> In-Reply-To: <1451565457-18756-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- diff.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/diff.c b/diff.c index 80eb0c2..dfbed41 100644 --- a/diff.c +++ b/diff.c @@ -759,17 +759,6 @@ struct diff_words_buffer { int orig_nr, orig_alloc; }; -static void diff_words_append(char *line, unsigned long len, - struct diff_words_buffer *buffer) -{ - ALLOC_GROW(buffer->text.ptr, buffer->text.size + len, buffer->alloc); - line++; - len--; - memcpy(buffer->text.ptr + buffer->text.size, line, len); - buffer->text.size += len; - buffer->text.ptr[buffer->text.size] = '\0'; -} - struct diff_words_style_elem { const char *prefix; const char *suffix; @@ -799,6 +788,17 @@ struct diff_words_data { struct diff_words_style *style; }; +static void diff_words_append(char *line, unsigned long len, + struct diff_words_buffer *buffer) +{ + ALLOC_GROW(buffer->text.ptr, buffer->text.size + len, buffer->alloc); + line++; + len--; + memcpy(buffer->text.ptr + buffer->text.size, line, len); + buffer->text.size += len; + buffer->text.ptr[buffer->text.size] = '\0'; +} + static int fn_out_diff_words_write_helper(FILE *fp, struct diff_words_style_elem *st_el, const char *newline, -- 2.3.0.rc1.137.g477eb31