author | Junio C Hamano <junkio@cox.net> | |
Wed, 21 Mar 2007 19:34:46 +0000 (12:34 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 22 Mar 2007 07:34:39 +0000 (00:34 -0700) | ||
commit | ccc744abbb27d3766175aee971991bc0f1fd4f00 | |
tree | a02363594bfc0356104b695f8f69009a8db7ee0f | tree | snapshot |
parent | 7d2f667b12334cea68087eb7da717efd7b3d80f6 | commit | diff |
tree-diff: avoid strncmp()
If we already know that some of the pathspecs can match later
entries in the tree we are looking at, we do not have to do more
expensive strncmp() upfront before comparing the length of the
match pattern and the path, as a path longer than the match
pattern will not match it, and a path shorter than the match
pattern will match only if the path is a directory-component
wise prefix of the match pattern.
Signed-off-by: Junio C Hamano <junkio@cox.net>
If we already know that some of the pathspecs can match later
entries in the tree we are looking at, we do not have to do more
expensive strncmp() upfront before comparing the length of the
match pattern and the path, as a path longer than the match
pattern will not match it, and a path shorter than the match
pattern will match only if the path is a directory-component
wise prefix of the match pattern.
Signed-off-by: Junio C Hamano <junkio@cox.net>
tree-diff.c | diff | blob | history |