Skip to content

Commit 667f71c

Browse files
peffgitster
authored andcommitted
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>
1 parent 16a465b commit 667f71c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

match-trees.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "tree-walk.h"
44
#include "object-store.h"
55

6-
static int score_missing(unsigned mode, const char *path)
6+
static int score_missing(unsigned mode)
77
{
88
int score;
99

@@ -16,7 +16,7 @@ static int score_missing(unsigned mode, const char *path)
1616
return score;
1717
}
1818

19-
static int score_differs(unsigned mode1, unsigned mode2, const char *path)
19+
static int score_differs(unsigned mode1, unsigned mode2)
2020
{
2121
int score;
2222

@@ -29,7 +29,7 @@ static int score_differs(unsigned mode1, unsigned mode2, const char *path)
2929
return score;
3030
}
3131

32-
static int score_matches(unsigned mode1, unsigned mode2, const char *path)
32+
static int score_matches(unsigned mode1, unsigned mode2)
3333
{
3434
int score;
3535

@@ -98,24 +98,22 @@ static int score_trees(const struct object_id *hash1, const struct object_id *ha
9898

9999
if (cmp < 0) {
100100
/* path1 does not appear in two */
101-
score += score_missing(one.entry.mode, one.entry.path);
101+
score += score_missing(one.entry.mode);
102102
update_tree_entry(&one);
103103
} else if (cmp > 0) {
104104
/* path2 does not appear in one */
105-
score += score_missing(two.entry.mode, two.entry.path);
105+
score += score_missing(two.entry.mode);
106106
update_tree_entry(&two);
107107
} else {
108108
/* path appears in both */
109109
if (!oideq(one.entry.oid, two.entry.oid)) {
110110
/* they are different */
111111
score += score_differs(one.entry.mode,
112-
two.entry.mode,
113-
one.entry.path);
112+
two.entry.mode);
114113
} else {
115114
/* same subtree or blob */
116115
score += score_matches(one.entry.mode,
117-
two.entry.mode,
118-
one.entry.path);
116+
two.entry.mode);
119117
}
120118
update_tree_entry(&one);
121119
update_tree_entry(&two);

0 commit comments

Comments
 (0)