From a8c40471ab0851bf9a58f7dc76f121258e0690e2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 21 Mar 2007 10:07:46 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- tree-walk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tree-walk.c') diff --git a/tree-walk.c b/tree-walk.c index a4a4e2a989..1869baede5 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; -- cgit v1.2.3