1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 08:56:08 +02:00

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 ef90ab66e8 (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>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2021-04-12 19:15:17 +02:00 committed by Junio C Hamano
parent a47fcbe6e4
commit 102fdd2e07

View File

@ -70,13 +70,9 @@ static int diff_grep(mmfile_t *one, mmfile_t *two,
static unsigned int contains(mmfile_t *mf, regex_t *regexp, kwset_t kws)
{
unsigned int cnt;
unsigned long sz;
const char *data;
sz = mf->size;
data = mf->ptr;
cnt = 0;
unsigned int cnt = 0;
unsigned long sz = mf->size;
const char *data = mf->ptr;
if (regexp) {
regmatch_t regmatch;