All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jim Hill <gjthill@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] strbuf_read: skip unnecessary strbuf_grow at eof
Date: Mon, 1 Jun 2015 06:59:01 -0400	[thread overview]
Message-ID: <20150601105901.GE31792@peff.net> (raw)
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

  reply	other threads:[~2015-06-01 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-31 18:16 [PATCH] strbuf_read: skip unnecessary strbuf_grow at eof Jim Hill
2015-06-01 10:59 ` Jeff King [this message]
2015-06-01 16:23   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150601105901.GE31792@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gjthill@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.