Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-24 04:10:10 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-24 04:10:10 +0300
commit05b4ed61f4e669da839892e03dad70e15d9a4cd3 (patch)
treeda7c3e04ce9309a67086e5a662acd8019e733f4f /fsck.c
parentcae598d9980661a978e2df4fb338518f7bf09572 (diff)
cocci: simplify "if (++u > 1)" to "if (u++)"
It is more common to use post-increment than pre-increment when the side effect is the primary thing we want in our code and in C in general (unlike C++). Initializing a variable to 0, incrementing it every time we do something, and checking if we have already done that thing to guard the code to do that thing, is easier to understand when written if (u++) ; /* we've done that! */ else do_it(); /* just once. */ but if you try to use pre-increment, you end up with a less natural looking if (++u > 1) Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
0 files changed, 0 insertions, 0 deletions