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

[PATCH 08/10] ref-filter: drop unused buf/sz pairs

From
Jeff King <peff@peff.net>
Date
Feb 14, 2019, 05:50 UTC
Message-ID
<20190214055054.GH20578@sigill.intra.peff.net>
In-Reply-To
<20190214054736.GA20091@sigill.intra.peff.net>

The grab_tag_values() and grab_commit_values() functions take both the "struct object" as well as the buf/sz pair for the actual object bytes. However, neither function uses the latter, as they pull the data directly from the parsed object struct.

Let's get rid of these misleading parameters.
Signed-off-by: Jeff King <peff@peff.net>
---
 ref-filter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c
index 422a9c9ae3..c9333b3181 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -913,7 +913,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_
 }
 
 /* See grab_values */
-static void grab_tag_values(struct atom_value *val, int deref, struct object *obj, void *buf, unsigned long sz)
+static void grab_tag_values(struct atom_value *val, int deref, struct object *obj)
 {
 	int i;
 	struct tag *tag = (struct tag *) obj;
@@ -935,7 +935,7 @@ static void grab_tag_values(struct atom_value *val, int deref, struct object *ob
 }
 
 /* See grab_values */
-static void grab_commit_values(struct atom_value *val, int deref, struct object *obj, void *buf, unsigned long sz)
+static void grab_commit_values(struct atom_value *val, int deref, struct object *obj)
 {
 	int i;
 	struct commit *commit = (struct commit *) obj;
@@ -1269,12 +1269,12 @@ static void grab_values(struct atom_value *val, int deref, struct object *obj, v
 {
 	switch (obj->type) {
 	case OBJ_TAG:
-		grab_tag_values(val, deref, obj, buf, sz);
+		grab_tag_values(val, deref, obj);
 		grab_sub_body_contents(val, deref, obj, buf, sz);
 		grab_person("tagger", val, deref, obj, buf, sz);
 		break;
 	case OBJ_COMMIT:
-		grab_commit_values(val, deref, obj, buf, sz);
+		grab_commit_values(val, deref, obj);
 		grab_sub_body_contents(val, deref, obj, buf, sz);
 		grab_person("author", val, deref, obj, buf, sz);
 		grab_person("committer", val, deref, obj, buf, sz);
-- 
2.21.0.rc1.567.g648f076c3f
Previous: Jeff KingNext: Jeff King
Message 9 of 11 in “dropping more unused function parameters”
  1. 0/10 dropping more unused function parametersJeff King, Feb 14, 2019
  2. 01/10 diff: drop options parameter from diffcore_fix_diff_index()Jeff King, Feb 14, 2019
  3. 02/10 diff: drop unused color reset parametersJeff King, Feb 14, 2019
  4. 03/10 diff: drop unused emit data parameter from sane_truncate_line()Jeff King, Feb 14, 2019
  5. 04/10 diff: drop complete_rewrite parameter from run_external_diff()Jeff King, Feb 14, 2019
  6. 05/10 merge-recursive: drop several unused parametersJeff King, Feb 14, 2019
  7. 06/10 pack-objects: drop unused parameter from oe_map_new_pack()Jeff King, Feb 14, 2019
  8. 07/10 files-backend: drop refs parameter from split_symref_update()Jeff King, Feb 14, 2019
  9. 08/10 ref-filter: drop unused buf/sz pairsJeff King, Feb 14, 2019
  10. 09/10 ref-filter: drop unused "obj" parametersJeff King, Feb 14, 2019
  11. 10/10 ref-filter: drop unused "sz" parametersJeff King, Feb 14, 2019

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.