Re: [PATCH 0/2] pkt-line.[ch]: dead code removal
From: Jeff King <hidden>
Date: 2021-10-21 16:30:29
On Thu, Oct 14, 2021 at 10:15:10PM +0200, Ævar Arnfjörð Bjarmason wrote:
Remove some dead code in pkt-line.[ch], perhaps someone has an objection to 2/2 as we could keep that function variant around "just in case", but it's trivial to use the underlying function (or re-add this utility), so shedding the unused code seems better.
These both look good to me. It's perhaps a little weird to shed the now-always-NULL src arguments from packet_read() in the second one, since the underlying function we wrap still allows them. But it does make the callers a little simpler, and I think if we added any new callers that I'd much rather see them use the struct-oriented packet_reader interface instead. Which is really why it we can get rid of this function in the first place; it's old callers are all using that interface. In the long run, I'd be quite happy if could get rid of all of the non-packet_reader calls entirely, but that's a much bigger topic. This is a nice incremental step in that direction. -Peff