aboutsummaryrefslogtreecommitdiff
path: root/tree-walk.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2007-03-21 10:07:46 -0700
committerJunio C Hamano <junkio@cox.net>2007-03-21 10:21:56 -0700
commita8c40471ab0851bf9a58f7dc76f121258e0690e2 (patch)
tree161da4c14a0d4f45cff256ca0df7789a81545e59 /tree-walk.c
parent171dccd511bb4642e4491dc5115549b67a859a5b (diff)
downloadgit-a8c40471ab0851bf9a58f7dc76f121258e0690e2.tar.gz
git-a8c40471ab0851bf9a58f7dc76f121258e0690e2.tar.xz
Remove "pathlen" from "struct name_entry"
Since we have the "tree_entry_len()" helper function these days, and don't need to do a full strlen(), there's no point in saving the path length - it's just redundant information. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'tree-walk.c')
-rw-r--r--tree-walk.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tree-walk.c b/tree-walk.c
index a4a4e2a98..1869baede 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -20,8 +20,8 @@ void *fill_tree_descriptor(struct tree_desc *desc, const unsigned char *sha1)
static int entry_compare(struct name_entry *a, struct name_entry *b)
{
return base_name_compare(
- a->path, a->pathlen, a->mode,
- b->path, b->pathlen, b->mode);
+ a->path, tree_entry_len(a->path, a->sha1), a->mode,
+ b->path, tree_entry_len(b->path, b->sha1), b->mode);
}
static void entry_clear(struct name_entry *a)
@@ -32,7 +32,6 @@ static void entry_clear(struct name_entry *a)
static void entry_extract(struct tree_desc *t, struct name_entry *a)
{
a->sha1 = tree_entry_extract(t, &a->path, &a->mode);
- a->pathlen = tree_entry_len(a->path, a->sha1);
}
void update_tree_entry(struct tree_desc *desc)
@@ -93,7 +92,6 @@ int tree_entry(struct tree_desc *desc, struct name_entry *entry)
entry->path = path;
len = strlen(path);
- entry->pathlen = len;
path += len + 1;
entry->sha1 = (const unsigned char *) path;