git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] sequencer: trivial cleanup

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Sep 8, 2013, 22:53 UTC
Message-ID
<CAMP44s1fE0XZScL_gU5JAEdC0hPFHPTovqXLx7gqvwVdZbBaVw@mail.gmail.com>
In-Reply-To
<1378680160-4720-1-git-send-email-artagnon@gmail.com>
On Sun, Sep 8, 2013 at 5:42 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 19 quoted lines
> 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.

-- 
Felipe Contreras
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 2 of 4 in “sequencer: trivial cleanup”
  1. sequencer: trivial cleanupRamkumar Ramachandra, Sep 8, 2013
  2. Felipe ContrerasSep 8, 2013
  3. Ramkumar RamachandraSep 8, 2013
  4. SZEDER GáborSep 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.