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

Re: [PATCH] strbuf_read: skip unnecessary strbuf_grow at eof

From
Jeff King <peff@peff.net>
Date
Jun 1, 2015, 10:59 UTC
Message-ID
<20150601105901.GE31792@peff.net>
In-Reply-To
<1433096205-14516-1-git-send-email-gjthill@gmail.com>
On Sun, May 31, 2015 at 11:16:45AM -0700, Jim Hill wrote:
> Make strbuf_read not try to do read_in_full's job too.  If xread returns
> less than was requested it can be either eof or an interrupted read.  If
> read_in_full returns less than was requested, it's eof. Use read_in_full
> to detect eof and not iterate when eof has been seen.

I think this makes sense. I somehow had to read this over several times to understand that the main point is not the cleanup, but rather the space savings from not doing an extra strbuf_grow. Perhaps it is because the main idea is mentioned only in the subject. Or perhaps I was just being dense.

-Peff
Previous: Jim HillNext: Junio C Hamano
Message 2 of 3 in “strbuf_read: skip unnecessary strbuf_grow at eof”
  1. strbuf_read: skip unnecessary strbuf_grow at eofJim Hill, May 31, 2015
  2. Jeff KingJun 1, 2015
  3. Junio C HamanoJun 1, 2015

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.