summaryrefslogtreecommitdiff
path: root/builtin-unpack-objects.c
diff options
context:
space:
mode:
authorBrandon Casey <casey@nrlssc.navy.mil>2008-10-06 23:39:10 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-10-08 14:30:59 (GMT)
commit19d4b416f429ac2d3f4c225aaf1af8761bcb03dd (patch)
tree6675797b5e141a32cf8c4d551be3dddc5e5fc020 /builtin-unpack-objects.c
parent276328ffb87cefdc515bee5f09916aea6e0244ed (diff)
downloadgit-19d4b416f429ac2d3f4c225aaf1af8761bcb03dd.zip
git-19d4b416f429ac2d3f4c225aaf1af8761bcb03dd.tar.gz
git-19d4b416f429ac2d3f4c225aaf1af8761bcb03dd.tar.bz2
Replace xmalloc/memset(0) pairs with xcalloc
Many call sites immediately initialize allocated memory with zero after calling xmalloc. A single call to xcalloc can replace this two-call sequence. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-unpack-objects.c')
-rw-r--r--builtin-unpack-objects.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index d2796b6..9f4bdd3 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -477,8 +477,7 @@ static void unpack_all(void)
if (!quiet)
progress = start_progress("Unpacking objects", nr_objects);
- obj_list = xmalloc(nr_objects * sizeof(*obj_list));
- memset(obj_list, 0, nr_objects * sizeof(*obj_list));
+ obj_list = xcalloc(nr_objects, sizeof(*obj_list));
for (i = 0; i < nr_objects; i++) {
unpack_one(i);
display_progress(progress, i + 1);