Skip to content

Commit

Permalink
Use base_name_compare instead of name_compare in recurse_manifest2
Browse files Browse the repository at this point in the history
This does not actually change the outcome, but can speed things a little
when there are files with a directory name as a prefix, followed by a
character < '/'.
  • Loading branch information
glandium committed Oct 8, 2019
1 parent 6318805 commit 1f9484e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helper/cinnabar-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,9 +814,9 @@ static void recurse_manifest2(const struct object_id *ref_tree_id,
} else if (!cur_entry_path.len) {
cmp = -1;
} else {
cmp = name_compare(
ref_entry_path.buf, ref_entry_path.len,
cur_entry_path.buf, cur_entry_path.len);
cmp = base_name_compare(
ref_entry_path.buf, ref_entry_path.len, ref_entry.mode,
cur_entry_path.buf, cur_entry_path.len, cur_entry.mode);
}
if (cmp <= 0) {
size_t len = base.len + ref_entry_path.len + 40;
Expand Down

0 comments on commit 1f9484e

Please sign in to comment.