1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-15 00:26:10 +02:00

Merge branch 'jc/cocci-preincr'

Code cleanup.

* jc/cocci-preincr:
  fsck: s/++i > 1/i++/
  cocci: simplify "if (++u > 1)" to "if (u++)"
This commit is contained in:
Junio C Hamano 2018-10-30 15:43:48 +09:00
commit da3e0752cd
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
@ preincrement @
identifier i;
@@
- ++i > 1
+ i++

2
fsck.c
View File

@ -479,7 +479,7 @@ static int fsck_walk_commit(struct commit *commit, void *data, struct fsck_optio
if (name) {
struct object *obj = &parents->item->object;
if (++counter > 1)
if (counter++)
put_object_name(options, obj, "%s^%d",
name, counter);
else if (generation > 0)