git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] pkt-line.[ch]: dead code removal

From
Jeff King <peff@peff.net>
Date
Oct 21, 2021, 16:30 UTC
Message-ID
<YXGVotqAxn859JZf@coredump.intra.peff.net>
In-Reply-To
<cover-0.2-00000000000-20211014T201317Z-avarab@gmail.com>
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
Previous: Ævar Arnfjörð Bjarmason
Message 4 of 4 in “pkt-line.[ch]: dead code removal”
  1. 0/2 pkt-line.[ch]: dead code removalÆvar Arnfjörð Bjarmason, Oct 14, 2021
  2. 1/2 pkt-line.[ch]: remove unused packet_buf_write_len()Ævar Arnfjörð Bjarmason, Oct 14, 2021
  3. 2/2 pkt-line.[ch]: remove unused packet_read_line_buf()Ævar Arnfjörð Bjarmason, Oct 14, 2021
  4. Jeff KingOct 21, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.