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

[PATCH 01/10] diff: drop options parameter from diffcore_fix_diff_index()

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

The sole purpose of this function is to fix the sorting order of the queued diff entries. It doesn't need to know about any diff options, so we can drop the unused parameter.

Signed-off-by: Jeff King <peff@peff.net>
---
 diff-lib.c | 2 +-
 diff.c     | 2 +-
 diff.h     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index 23c8d351b3..a838c219ec 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -531,7 +531,7 @@ int run_diff_index(struct rev_info *revs, int cached)
 		exit(128);
 
 	diff_set_mnemonic_prefix(&revs->diffopt, "c/", cached ? "i/" : "w/");
-	diffcore_fix_diff_index(&revs->diffopt);
+	diffcore_fix_diff_index();
 	diffcore_std(&revs->diffopt);
 	diff_flush(&revs->diffopt);
 	trace_performance_leave("diff-index");
diff --git a/diff.c b/diff.c
index 5306c48652..3e7d11fb70 100644
--- a/diff.c
+++ b/diff.c
@@ -6224,7 +6224,7 @@ static int diffnamecmp(const void *a_, const void *b_)
 	return strcmp(name_a, name_b);
 }
 
-void diffcore_fix_diff_index(struct diff_options *options)
+void diffcore_fix_diff_index(void)
 {
 	struct diff_queue_struct *q = &diff_queued_diff;
 	QSORT(q->queue, q->nr, diffnamecmp);
diff --git a/diff.h b/diff.h
index b512d0477a..8f55aad5ba 100644
--- a/diff.h
+++ b/diff.h
@@ -367,7 +367,7 @@ int git_config_rename(const char *var, const char *value);
 #define DIFF_PICKAXE_IGNORE_CASE	32
 
 void diffcore_std(struct diff_options *);
-void diffcore_fix_diff_index(struct diff_options *);
+void diffcore_fix_diff_index(void);
 
 #define COMMON_DIFF_OPTIONS_HELP \
 "\ncommon diff options:\n" \
-- 
2.21.0.rc1.567.g648f076c3f
Previous: Jeff KingNext: Jeff King
Message 2 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.