Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cache-tree.c: use ALLOC_GROW() in find_subtree()
author
Dmitry S. Dolzhenko
<dmitrys.dolzhenko@yandex.ru>
Mon, 3 Mar 2014 22:31:51 +0000
(
02:31
+0400)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 3 Mar 2014 22:45:35 +0000
(14:45 -0800)
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
5cbbe13
)
diff --git
a/cache-tree.c
b/cache-tree.c
index 0bbec432165874bd36b1f220301de7f1363626dc..30149d1c42f94cf28e10db317ad3337c8e534ae1 100644
(file)
--- a/
cache-tree.c
+++ b/
cache-tree.c
@@
-75,11
+75,7
@@
static struct cache_tree_sub *find_subtree(struct cache_tree *it,
return NULL;
pos = -pos-1;
- if (it->subtree_alloc <= it->subtree_nr) {
- it->subtree_alloc = alloc_nr(it->subtree_alloc);
- it->down = xrealloc(it->down, it->subtree_alloc *
- sizeof(*it->down));
- }
+ ALLOC_GROW(it->down, it->subtree_nr + 1, it->subtree_alloc);
it->subtree_nr++;
down = xmalloc(sizeof(*down) + pathlen + 1);