tree_entry_interesting() can signal to its callers not only if the given entry matches one of the specified paths, but whether all remaining paths will (or will not) match. When no paths are specified, all paths are considered interesting, so intead of returning 1 (this path is interesting) return 2 (all paths are interesting). This will allow the caller to avoid calling tree_entry_interesting() again, which theoretically should speed up tree walking. I am not able to measure any actual gains in practice, but it certainly can not hurt and makes more sense to me. Signed-off-by: Elijah Newren <newren@xxxxxxxxx> --- tree-diff.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 2fb670b..a740a9c 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -101,7 +101,7 @@ int tree_entry_interesting(struct tree_desc *desc, const char *base, int baselen int never_interesting = -1; if (!opt->nr_paths) - return 1; + return 2; sha1 = tree_entry_extract(desc, &path, &mode); -- 1.7.2.2.39.gf7e23 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html