diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2013-03-24 23:46:28 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-25 09:00:30 -0700 |
commit | d8febde370aa464a5208cf094f306343e4ecb6dc (patch) | |
tree | 7787c467bcb876da2629452c2fa9e01d13926501 /vcs-svn/svndump.c | |
parent | submodule: clarify logic in show_submodule_summary (diff) | |
download | tgif-d8febde370aa464a5208cf094f306343e4ecb6dc.tar.xz |
match-trees: simplify score_trees() using tree_entry()
Convert the loop in score_trees() to tree_entry(). The code becomes
shorter and simpler because the calls to update_tree_entry() are not
needed any more.
Another benefit is that we need less variables to track the current
tree entries; as a side-effect of that the compiler has an easier
job figuring out the control flow and thus can avoid false warnings
about uninitialized variables.
Using struct name_entry also allows the use of tree_entry_len() for
finding the path length instead of strlen(), which may be slightly
more efficient.
Also unify the handling of missing entries in one of the two trees
(i.e. added or removed files): Just set cmp appropriately first, no
matter if we ran off the end of a tree or if we actually have two
entries to compare, and check its value a bit later without
duplicating the handler code.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'vcs-svn/svndump.c')
0 files changed, 0 insertions, 0 deletions