From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
Git List <git@vger.kernel.org>
Subject: Re: [PATCH] sequencer: trivial cleanup
Date: Mon, 9 Sep 2013 02:20:27 +0200 [thread overview]
Message-ID: <20130909002026.GF28959@goldbirke> (raw)
In-Reply-To: <CAMP44s1fE0XZScL_gU5JAEdC0hPFHPTovqXLx7gqvwVdZbBaVw@mail.gmail.com>
Hi,
On Sun, Sep 08, 2013 at 05:53:19PM -0500, Felipe Contreras wrote:
> On Sun, Sep 8, 2013 at 5:42 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
> > Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> > ---
> > sequencer.c | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/sequencer.c b/sequencer.c
> > index 351548f..8ed9f98 100644
> > --- a/sequencer.c
> > +++ b/sequencer.c
> > @@ -466,10 +466,7 @@ static int allow_empty(struct replay_opts *opts, struct commit *commit)
> > empty_commit = is_original_commit_empty(commit);
> > if (empty_commit < 0)
> > return empty_commit;
> > - if (!empty_commit)
> > - return 0;
> > - else
> > - return 1;
> > + return empty_commit ? 0 : 1;
> > }
>
> Isn't it the other way around? Moreover, 'return !!empty_commit;'
> would be simpler.
Considering the possible return values from
is_original_commit_empty(), I think all this could be written as
return is_original_commit_empty(commit);
Best,
Gábor
prev parent reply other threads:[~2013-09-09 0:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-08 22:42 [PATCH] sequencer: trivial cleanup Ramkumar Ramachandra
2013-09-08 22:53 ` Felipe Contreras
2013-09-08 22:57 ` Ramkumar Ramachandra
2013-09-09 0:20 ` SZEDER Gábor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130909002026.GF28959@goldbirke \
--to=szeder@ira.uka.de \
--cc=artagnon@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).