{"thread":{"id":"34883","subject":"[PATCH] sequencer: trivial cleanup","startedAt":"2013-09-08T22:42:40Z","lastAt":"2013-09-09T00:20:27Z","messageCount":4,"participants":["Ramkumar Ramachandra","Felipe Contreras","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"227162","messageId":"1378680160-4720-1-git-send-email-artagnon@gmail.com","threadId":"34883","inReplyTo":null,"subject":"[PATCH] sequencer: trivial cleanup","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-09-08T22:42:40Z","receivedAt":"2013-09-08T22:42:40Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n sequencer.c | 5 +----\n 1 file changed, 1 insertion(+), 4 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 351548f..8ed9f98 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -466,10 +466,7 @@ static int allow_empty(struct replay_opts *opts, struct commit *commit)\n \tempty_commit = is_original_commit_empty(commit);\n \tif (empty_commit < 0)\n \t\treturn empty_commit;\n-\tif (!empty_commit)\n-\t\treturn 0;\n-\telse\n-\t\treturn 1;\n+\treturn empty_commit ? 0 : 1;\n }\n \n static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n-- \n1.8.4.100.gde18f6d.dirty\n"},{"id":"227164","messageId":"CAMP44s1fE0XZScL_gU5JAEdC0hPFHPTovqXLx7gqvwVdZbBaVw@mail.gmail.com","threadId":"34883","inReplyTo":"1378680160-4720-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] sequencer: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-08T22:53:19Z","receivedAt":"2013-09-08T22:53:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Sep 8, 2013 at 5:42 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  sequencer.c | 5 +----\n>  1 file changed, 1 insertion(+), 4 deletions(-)\n>\n> diff --git a/sequencer.c b/sequencer.c\n> index 351548f..8ed9f98 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -466,10 +466,7 @@ static int allow_empty(struct replay_opts *opts, struct commit *commit)\n>         empty_commit = is_original_commit_empty(commit);\n>         if (empty_commit < 0)\n>                 return empty_commit;\n> -       if (!empty_commit)\n> -               return 0;\n> -       else\n> -               return 1;\n> +       return empty_commit ? 0 : 1;\n>  }\n\nIsn't it the other way around? Moreover, 'return !!empty_commit;'\nwould be simpler.\n\n-- \nFelipe Contreras\n"},{"id":"227166","messageId":"CALkWK0mx6dc0=YAwCPKSrCFqCAytOQXhSv36k1S_59sFr_bBWw@mail.gmail.com","threadId":"34883","inReplyTo":"CAMP44s1fE0XZScL_gU5JAEdC0hPFHPTovqXLx7gqvwVdZbBaVw@mail.gmail.com","subject":"Re: [PATCH] sequencer: trivial cleanup","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-09-08T22:57:43Z","receivedAt":"2013-09-08T22:57:43Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Felipe Contreras wrote:\n>>  sequencer.c | 5 +----\n>>  1 file changed, 1 insertion(+), 4 deletions(-)\n>>\n>> diff --git a/sequencer.c b/sequencer.c\n>> index 351548f..8ed9f98 100644\n>> --- a/sequencer.c\n>> +++ b/sequencer.c\n>> @@ -466,10 +466,7 @@ static int allow_empty(struct replay_opts *opts, struct commit *commit)\n>>         empty_commit = is_original_commit_empty(commit);\n>>         if (empty_commit < 0)\n>>                 return empty_commit;\n>> -       if (!empty_commit)\n>> -               return 0;\n>> -       else\n>> -               return 1;\n>> +       return empty_commit ? 0 : 1;\n>>  }\n>\n> Isn't it the other way around? Moreover, 'return !!empty_commit;'\n> would be simpler.\n\nYeah, thanks for pointing out this grave stupidity. This seems to be\ninconsequential as far as the tests are concerned: have to do some\nmajor yak shaving.\n"},{"id":"227175","messageId":"20130909002026.GF28959@goldbirke","threadId":"34883","inReplyTo":"CAMP44s1fE0XZScL_gU5JAEdC0hPFHPTovqXLx7gqvwVdZbBaVw@mail.gmail.com","subject":"Re: [PATCH] sequencer: trivial cleanup","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-09-09T00:20:27Z","receivedAt":"2013-09-09T00:20:27Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nOn Sun, Sep 08, 2013 at 05:53:19PM -0500, Felipe Contreras wrote:\n> On Sun, Sep 8, 2013 at 5:42 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> > Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> > ---\n> >  sequencer.c | 5 +----\n> >  1 file changed, 1 insertion(+), 4 deletions(-)\n> >\n> > diff --git a/sequencer.c b/sequencer.c\n> > index 351548f..8ed9f98 100644\n> > --- a/sequencer.c\n> > +++ b/sequencer.c\n> > @@ -466,10 +466,7 @@ static int allow_empty(struct replay_opts *opts, struct commit *commit)\n> >         empty_commit = is_original_commit_empty(commit);\n> >         if (empty_commit < 0)\n> >                 return empty_commit;\n> > -       if (!empty_commit)\n> > -               return 0;\n> > -       else\n> > -               return 1;\n> > +       return empty_commit ? 0 : 1;\n> >  }\n> \n> Isn't it the other way around? Moreover, 'return !!empty_commit;'\n> would be simpler.\n\nConsidering the possible return values from\nis_original_commit_empty(), I think all this could be written as\n\n  return is_original_commit_empty(commit);\n\n\nBest,\nGábor\n"}]}