зеркало из https://github.com/microsoft/git.git
Merge branch 'rs/pack-objects-no-unnecessary-realloc' into maint
"git pack-objects" unnecessarily copied the previous contents when extending the hashtable, even though it will populate the table from scratch anyway. * rs/pack-objects-no-unnecessary-realloc: pack-objects: use free()+xcalloc() instead of xrealloc()+memset()
This commit is contained in:
Коммит
5327207e0f
|
@ -47,8 +47,8 @@ static void rehash_objects(struct packing_data *pdata)
|
|||
if (pdata->index_size < 1024)
|
||||
pdata->index_size = 1024;
|
||||
|
||||
pdata->index = xrealloc(pdata->index, sizeof(uint32_t) * pdata->index_size);
|
||||
memset(pdata->index, 0, sizeof(int) * pdata->index_size);
|
||||
free(pdata->index);
|
||||
pdata->index = xcalloc(pdata->index_size, sizeof(*pdata->index));
|
||||
|
||||
entry = pdata->objects;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче