Re: [RFC] cocci: .buf in a strbuf object can never be NULL
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 22, 2026, 01:22 UTC
- Message-ID
- <xmqq5x6oac9t.fsf@gitster.g>
- In-Reply-To
- <20260321211828.GB736981@coredump.intra.peff.net>
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.