From: Alex Riesen Date: Thu, 09 Oct 2008 21:28:08 GMT Subject: Re: [RFC PATCH 2/2] Replace calls to strbuf_init(&foo, 0) with static STRBUF_INIT initializer Message-ID: <81b0412b0810091428o6a4ea772q6a10cd295e4fcd7d@mail.gmail.com> In-Reply-To: 2008/10/9 Brandon Casey : > 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 > --- > > > 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.