git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Riesen" <raa.lkml@gmail.com>
To: "Brandon Casey" <casey@nrlssc.navy.mil>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: [RFC PATCH 2/2] Replace calls to strbuf_init(&foo, 0) with static STRBUF_INIT initializer
Date: Thu, 9 Oct 2008 23:28:08 +0200	[thread overview]
Message-ID: <81b0412b0810091428o6a4ea772q6a10cd295e4fcd7d@mail.gmail.com> (raw)
In-Reply-To: <UUi8gSMV6CruoYIkVNOQZ4FNzsbqZcSNu6jdYH8GqIo@cipher.nrlssc.navy.mil>

2008/10/9 Brandon Casey <casey@nrlssc.navy.mil>:
> Many call sites use strbuf_init(&foo, 0) to initialize local strbuf variable
> "foo" which has not been accessed since its declaration. These can be
> replaced with a static initialization using the STRBUF_INIT macro which is
> just as readable, saves a function call, and takes up fewer lines.
>
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> ---
>
>
> This does the same thing for strbuf_init() that the last one did for memset().
>

But it does this using a predefined interface (using the STRBUG_INIT macro),
so next time strbuf changed, the code using it may be left as is.

I didn't like the memset->zero-init, but I do like this one.
It is a bit unclear, by the way, why strbuf_init wasn't inlined.

      reply	other threads:[~2008-10-09 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 19:12 [RFC PATCH 2/2] Replace calls to strbuf_init(&foo, 0) with static STRBUF_INIT initializer Brandon Casey
2008-10-09 21:28 ` Alex Riesen [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=81b0412b0810091428o6a4ea772q6a10cd295e4fcd7d@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=casey@nrlssc.navy.mil \
    --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).