match-trees: drop unused path parameter from score functions

The scores do not take the particular path into account at all. It's possible they could, but these are all static file-local functions. It won't be a big deal to re-add the parameter if they ever need it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 24, 2019 at 08:11 UTC 667f71c36c95840c561297a5dfde2aa553c77c30
1 file changed +7 -9
match-trees.c
+7 -9
@@ -3,7 +3,7 @@
3 #include "tree-walk.h"
4 #include "object-store.h"
5
6 -static int score_missing(unsigned mode, const char *path)
6 +static int score_missing(unsigned mode)
7 {
8 int score;
9
@@ -16,7 +16,7 @@ static int score_missing(unsigned mode, const char *path)
16 return score;
17 }
18
19 -static int score_differs(unsigned mode1, unsigned mode2, const char *path)
19 +static int score_differs(unsigned mode1, unsigned mode2)
20 {
21 int score;
22
@@ -29,7 +29,7 @@ static int score_differs(unsigned mode1, unsigned mode2, const char *path)
29 return score;
30 }
31
32 -static int score_matches(unsigned mode1, unsigned mode2, const char *path)
32 +static int score_matches(unsigned mode1, unsigned mode2)
33 {
34 int score;
35
@@ -98,24 +98,22 @@ static int score_trees(const struct object_id *hash1, const struct object_id *ha
98
99 if (cmp < 0) {
100 /* path1 does not appear in two */
101 - score += score_missing(one.entry.mode, one.entry.path);
101 + score += score_missing(one.entry.mode);
102 update_tree_entry(&one);
103 } else if (cmp > 0) {
104 /* path2 does not appear in one */
105 - score += score_missing(two.entry.mode, two.entry.path);
105 + score += score_missing(two.entry.mode);
106 update_tree_entry(&two);
107 } else {
108 /* path appears in both */
109 if (!oideq(one.entry.oid, two.entry.oid)) {
110 /* they are different */
111 score += score_differs(one.entry.mode,
112 - two.entry.mode,
113 - one.entry.path);
112 + two.entry.mode);
113 } else {
114 /* same subtree or blob */
115 score += score_matches(one.entry.mode,
117 - two.entry.mode,
118 - one.entry.path);
116 + two.entry.mode);
117 }
118 update_tree_entry(&one);
119 update_tree_entry(&two);