diff_tree(): Skip skip_uninteresting() when all remaining paths interesting
commit7e1ec0d415dbea96d4ec6995c00cb66cdff7ceff
authorElijah Newren <newren@gmail.com>
Thu, 26 Aug 2010 06:21:49 +0000 (26 00:21 -0600)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Aug 2010 16:53:36 +0000 (26 09:53 -0700)
tree0f7b36991062180d6804e2a9606b6593757dede0
parent4a5e74feb1a75a479acbc2f839e930966fdc2f2f
diff_tree(): Skip skip_uninteresting() when all remaining paths interesting

In 1d848f6 (tree_entry_interesting(): allow it to say "everything is
interesting" 2007-03-21), both show_tree() and skip_uninteresting() were
modified to determine if all remaining tree entries were interesting.
However, the latter returns as soon as it finds the first interesting path,
without any way to signal to its caller (namely, diff_tree()) that all
remaining paths are interesting, making these extra checks useless.

Pass whether all remaining entries are interesting back to diff_tree(), and
whenever they are, have diff_tree() skip subsequent calls to
skip_uninteresting().

With this change, I measure speedups of 3-4% for the commands

  $ git rev-list --quiet HEAD -- Documentation/
  $ git rev-list --quiet HEAD -- t/

in git.git.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-diff.c