Re: [RFC] cocci: .buf in a strbuf object can never be NULL
On Sat, Mar 21, 2026 at 06:22:38PM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> 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