From: Brandon Casey <drafnel@gmail.com>
To: git@vger.kernel.org
Cc: Brandon Casey <drafnel@gmail.com>
Subject: [PATCH] strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()
Date: Wed, 5 Oct 2011 23:21:33 -0500 [thread overview]
Message-ID: <1317874893-4167-1-git-send-email-drafnel@gmail.com> (raw)
This use of strbuf_grow() is a historical artifact that was once used to
ensure that strbuf.buf was allocated and properly nul-terminated. This
was added before the introduction of the slopbuf in b315c5c0, which
guarantees that strbuf.buf always points to a usable nul-terminated string.
So let's remove it.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
strbuf.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/strbuf.c b/strbuf.c
index 9ff1b59..3ad2cc0 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -357,7 +357,6 @@ int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)
{
int ch;
- strbuf_grow(sb, 0);
if (feof(fp))
return EOF;
--
1.7.7.1.ge3b6f
reply other threads:[~2011-10-06 4:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1317874893-4167-1-git-send-email-drafnel@gmail.com \
--to=drafnel@gmail.com \
--cc=git@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).