mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
use CALLOC_ARRAY
Add and apply a semantic patch for converting code that open-codes CALLOC_ARRAY to use it instead. It shortens the code and infers the element size automatically. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f1121499e6
commit
ca56dadb4b
@@ -25,7 +25,7 @@
|
||||
struct bitmap *bitmap_word_alloc(size_t word_alloc)
|
||||
{
|
||||
struct bitmap *bitmap = xmalloc(sizeof(struct bitmap));
|
||||
bitmap->words = xcalloc(word_alloc, sizeof(eword_t));
|
||||
CALLOC_ARRAY(bitmap->words, word_alloc);
|
||||
bitmap->word_alloc = word_alloc;
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user