diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-05-28 15:07:07 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-28 19:40:18 -0700 |
commit | d2eafb76611670d7573f9409b0c727019fe50e18 (patch) | |
tree | 61476cd4ade7077cfe7a8f94270cd0dede4870c1 /builtin-read-tree.c | |
parent | Don't use "sscanf()" for tree mode scanning (diff) | |
download | tgif-d2eafb76611670d7573f9409b0c727019fe50e18.tar.xz |
Add raw tree buffer info to "struct tree"
This allows us to avoid allocating information for names etc, because
we can just use the information from the tree buffer directly.
We still keep the old "tree_entry_list" in struct tree as well, so old
users aren't affected, apart from the fact that the allocations are
different (if you free a tree entry, you should no longer free the name
allocation for it, since it's allocated as part of "tree->buffer")
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-read-tree.c')
-rw-r--r-- | builtin-read-tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-read-tree.c b/builtin-read-tree.c index ec40d013c4..740a8c7e66 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -38,7 +38,7 @@ static struct tree_entry_list df_conflict_list = { typedef int (*merge_fn_t)(struct cache_entry **src); -static int entcmp(char *name1, int dir1, char *name2, int dir2) +static int entcmp(const char *name1, int dir1, const char *name2, int dir2) { int len1 = strlen(name1); int len2 = strlen(name2); @@ -66,7 +66,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len, int src_size = len + 1; do { int i; - char *first; + const char *first; int firstdir = 0; int pathlen; unsigned ce_size; |