Skip to content

Commit

Permalink
Merge branch 'dm/tree-walk'
Browse files Browse the repository at this point in the history
* dm/tree-walk:
  tree-walk: micro-optimization in tree_entry_interesting
  tree-walk: drop unused parameter from match_dir_prefix
  • Loading branch information
Junio C Hamano committed Oct 10, 2011
2 parents 59b32ff + 1b74092 commit 4909bbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tree-walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ static int match_entry(const struct name_entry *entry, int pathlen,
return 0;
}

static int match_dir_prefix(const char *base, int baselen,
static int match_dir_prefix(const char *base,
const char *match, int matchlen)
{
if (strncmp(base, match, matchlen))
Expand Down Expand Up @@ -606,7 +606,7 @@ int tree_entry_interesting(const struct name_entry *entry,

if (baselen >= matchlen) {
/* If it doesn't match, move along... */
if (!match_dir_prefix(base_str, baselen, match, matchlen))
if (!match_dir_prefix(base_str, match, matchlen))
goto match_wildcards;

if (!ps->recursive || ps->max_depth == -1)
Expand All @@ -618,8 +618,8 @@ int tree_entry_interesting(const struct name_entry *entry,
ps->max_depth);
}

/* Does the base match? */
if (!strncmp(base_str, match, baselen)) {
/* Either there must be no base, or the base must match. */
if (baselen == 0 || !strncmp(base_str, match, baselen)) {
if (match_entry(entry, pathlen,
match + baselen, matchlen - baselen,
&never_interesting))
Expand Down

0 comments on commit 4909bbe

Please sign in to comment.