Re: [PATCH v3 2/2] fsck.c: Rewrite fsck_commit() to use skip_prefix()

2014-03-13 Thread Junio C Hamano
Yuxuan Shui yshu...@gmail.com 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

Re: [PATCH v3 2/2] fsck.c: Rewrite fsck_commit() to use skip_prefix()

2014-03-13 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com 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