From b60e188c51242b72061b5f2f0d4df80397f6125a Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Wed, 11 Jul 2012 11:22:37 +0200 Subject: Strip namelen out of ce_flags into a ce_namelen field Strip the name length from the ce_flags field and move it into its own ce_namelen field in struct cache_entry. This will both give us a tiny bit of a performance enhancement when working with long pathnames and is a refactoring for more readability of the code. It enhances readability, by making it more clear what is a flag, and where the length is stored and make it clear which functions use stages in comparisions and which only use the length. It also makes CE_NAMEMASK private, so that users don't mistakenly write the name length in the flags. Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- builtin/blame.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'builtin/blame.c') diff --git a/builtin/blame.c b/builtin/blame.c index 960c58d855..0d50273ce9 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2171,7 +2171,8 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, ce = xcalloc(1, size); hashcpy(ce->sha1, origin->blob_sha1); memcpy(ce->name, path, len); - ce->ce_flags = create_ce_flags(len, 0); + ce->ce_flags = create_ce_flags(0); + ce->ce_namelen = len; ce->ce_mode = create_ce_mode(mode); add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE); -- cgit v1.2.1