aboutsummaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2012-07-11 11:22:37 +0200
committerJunio C Hamano <gitster@pobox.com>2012-07-11 09:42:45 -0700
commitb60e188c51242b72061b5f2f0d4df80397f6125a (patch)
treea98bd286f05bca385fba527f3c7971a86cc78c14 /unpack-trees.c
parent01388518c30c20ccbbb9f99e00314ef291ecda37 (diff)
downloadgit-b60e188c51242b72061b5f2f0d4df80397f6125a.tar.gz
git-b60e188c51242b72061b5f2f0d4df80397f6125a.tar.xz
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 <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 33a581924..00710b978 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -539,7 +539,8 @@ static struct cache_entry *create_ce_entry(const struct traverse_info *info, con
struct cache_entry *ce = xcalloc(1, cache_entry_size(len));
ce->ce_mode = create_ce_mode(n->mode);
- ce->ce_flags = create_ce_flags(len, stage);
+ ce->ce_flags = create_ce_flags(stage);
+ ce->ce_namelen = len;
hashcpy(ce->sha1, n->sha1);
make_traverse_path(ce->name, info, n);