author | Elijah Newren <newren@gmail.com> | |
Thu, 26 Aug 2010 06:21:48 +0000 (00:21 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 26 Aug 2010 16:53:36 +0000 (09:53 -0700) | ||
commit | 4a5e74feb1a75a479acbc2f839e930966fdc2f2f | |
tree | 6556eb4d2c1ce1c7692258dbb681e45f6559a668 | tree | snapshot |
parent | dabb061fa358e8884889632f0be5b6c76916c893 | commit | diff |
tree_entry_interesting(): Make return value more specific
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 seems to
make the code more readable to me.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 seems to
make the code more readable to me.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-diff.c | diff | blob | history |