git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 6/8] config: drop unused parameter from maybe_remove_section()
Date: Thu, 24 Jan 2019 08:12:32 -0500	[thread overview]
Message-ID: <20190124131232.GF22398@sigill.intra.peff.net> (raw)
In-Reply-To: <20190124131104.GA24017@sigill.intra.peff.net>

We don't need the contents buffer to drop a section; the parse
information in the config_store_data parameter is enough for our logic.

Signed-off-by: Jeff King <peff@peff.net>
---
 config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/config.c b/config.c
index ff521eb27a..24ad1a9854 100644
--- a/config.c
+++ b/config.c
@@ -2565,7 +2565,6 @@ static ssize_t write_pair(int fd, const char *key, const char *value,
  * entry (which all are to be removed).
  */
 static void maybe_remove_section(struct config_store_data *store,
-				 const char *contents,
 				 size_t *begin_offset, size_t *end_offset,
 				 int *seen_ptr)
 {
@@ -2850,7 +2849,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
 				replace_end = store.parsed[j].end;
 				copy_end = store.parsed[j].begin;
 				if (!value)
-					maybe_remove_section(&store, contents,
+					maybe_remove_section(&store,
 							     &copy_end,
 							     &replace_end, &i);
 				/*
-- 
2.20.1.842.g8986705066


  parent reply	other threads:[~2019-01-24 13:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 13:11 [PATCH 0/9] drop some unused parameters Jeff King
2019-01-24 13:11 ` [PATCH 1/8] match-trees: drop unused path parameter from score functions Jeff King
2019-01-24 13:11 ` [PATCH 2/8] apply: drop unused "def" parameter from find_name_gnu() Jeff King
2019-01-24 13:11 ` [PATCH 3/8] create_bundle(): drop unused "header" parameter Jeff King
2019-01-24 13:11 ` [PATCH 4/8] column: drop unused "opts" parameter in item_length() Jeff King
2019-01-24 13:12 ` [PATCH 5/8] show_date_relative(): drop unused "tz" parameter Jeff King
2019-01-24 14:07   ` Derrick Stolee
2019-01-24 13:12 ` Jeff King [this message]
2019-01-24 13:12 ` [PATCH 7/8] convert: drop len parameter from conversion checks Jeff King
2019-01-24 13:12 ` [PATCH 8/8] convert: drop path parameter from actual conversion functions Jeff King
2019-01-24 14:09 ` [PATCH 0/9] drop some unused parameters Derrick Stolee
2019-01-24 20:35 ` Junio C Hamano
2019-01-25  1:53 ` brian m. carlson

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=20190124131232.GF22398@sigill.intra.peff.net \
    --to=peff@peff.net \
    --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).