From: Jeff King Date: Sun, 22 Mar 2026 01:40:23 GMT Subject: Re: [RFC] cocci: .buf in a strbuf object can never be NULL Message-ID: <20260322014023.GA816875@coredump.intra.peff.net> In-Reply-To: On Sat, Mar 21, 2026 at 06:22:38PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Could the function be rewritten differently, or maybe even made a little > > simpler? Perhaps, but who cares? The function has been largely untouched > > for a decade and the behavior is fine. And there are a bunch of pitfalls > > that a rewrite risks falling into. > > Well, my only interest in this codepath was to get rid of "if > (!sb->buf)" so that I can lift the special case in the Coccinelle > rule. Nothing else. Yeah. IMHO it is better just to keep the special case. -Peff