summaryrefslogtreecommitdiffstats
path: root/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-01 18:04:38 +0100
committerJunio C Hamano <gitster@pobox.com>2019-12-01 18:04:38 +0100
commit8faff3899e1fdefbdd143eaf5ce3b96532205bc7 (patch)
treed42f26e57cc524498fb3e49a9897b413d46a5e31 /pack-objects.c
parentMerge branch 'dl/complete-rebase-onto' (diff)
parentpack-objects: avoid pointless oe_map_new_pack() calls (diff)
downloadgit-8faff3899e1fdefbdd143eaf5ce3b96532205bc7.tar.xz
git-8faff3899e1fdefbdd143eaf5ce3b96532205bc7.zip
Merge branch 'jk/optim-in-pack-idx-conversion'
Code clean-up. * jk/optim-in-pack-idx-conversion: pack-objects: avoid pointless oe_map_new_pack() calls
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pack-objects.c b/pack-objects.c
index c6250d77f4..5e5a3c62d9 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -119,7 +119,10 @@ void oe_map_new_pack(struct packing_data *pack)
{
uint32_t i;
- REALLOC_ARRAY(pack->in_pack, pack->nr_alloc);
+ if (pack->in_pack)
+ BUG("packing_data has already been converted to pack array");
+
+ ALLOC_ARRAY(pack->in_pack, pack->nr_alloc);
for (i = 0; i < pack->nr_objects; i++)
pack->in_pack[i] = oe_in_pack(pack, pack->objects + i);