From 183aca0e20a2cf2923a2f56352ffa2cefb49afcc Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Tue, 21 Aug 2018 23:32:39 +0300 Subject: libglusterfs/src/quota-common-utils.c:move to GF_MALLOC() instead of GF_CALLOC() when It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! Change-Id: Ie2a634d768904636160582189a5f0390668b37bb updates: bz#1193929 Signed-off-by: Yaniv Kaul --- libglusterfs/src/quota-common-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/quota-common-utils.c b/libglusterfs/src/quota-common-utils.c index ad7e4dcba1c..623248f2eb6 100644 --- a/libglusterfs/src/quota-common-utils.c +++ b/libglusterfs/src/quota-common-utils.c @@ -106,7 +106,7 @@ quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta, int32_t ret = -ENOMEM; quota_meta_t *value = NULL; - value = GF_CALLOC (1, sizeof (quota_meta_t), gf_common_quota_meta_t); + value = GF_MALLOC (sizeof (quota_meta_t), gf_common_quota_meta_t); if (value == NULL) { goto out; } -- cgit