Junio C Hamano writes:
>> -if (memcmp(buffer, "tree ", 5))
>> +buffer = skip_prefix(buffer, "tree ");
>> +if (buffer == NULL)
>
> We encourage people to write this as:
>
> if (!buffer)
>
> The same comment applies to other new lines in this patch.
I also see a lot of repetition
Yuxuan Shui writes:
> Currently we use memcmp() in fsck_commit() to check if buffer start
> with a certain prefix, and skip the prefix if it does. This is exactly
> what skip_prefix() does. And since skip_prefix() has a self-explaintory
> name, this could make the code more readable.
>
> Signed-o
Currently we use memcmp() in fsck_commit() to check if buffer start
with a certain prefix, and skip the prefix if it does. This is exactly
what skip_prefix() does. And since skip_prefix() has a self-explaintory
name, this could make the code more readable.
Signed-off-by: Yuxuan Shui
---
fsck.c |
3 matches
Mail list logo