pickaxe/style: consolidate declarations and assignments

Refactor contains() to do its assignments at the same time that it does its declarations. This code could have been refactored in ef90ab66e8e (pickaxe: use textconv for -S counting, 2012-10-28) when a function call between the declarations and assignments was removed. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Apr 12, 2021 at 19:15 UTC 102fdd2e07f72919060224b3eb3560524d6cf1f9
1 file changed +3 -7
diffcore-pickaxe.c
+3 -7
@@ -70,13 +70,9 @@ static int diff_grep(mmfile_t *one, mmfile_t *two,
70
71 static unsigned int contains(mmfile_t *mf, regex_t *regexp, kwset_t kws)
72 {
73 - unsigned int cnt;
74 - unsigned long sz;
75 - const char *data;
76 -
77 - sz = mf->size;
78 - data = mf->ptr;
79 - cnt = 0;
73 + unsigned int cnt = 0;
74 + unsigned long sz = mf->size;
75 + const char *data = mf->ptr;
76
77 if (regexp) {
78 regmatch_t regmatch;