diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-08 21:40:44 +0300 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2018-08-22 13:31:14 +0000 |
commit | 7674ea878e934a072c5f40eafc78f7886b24808c (patch) | |
tree | 8d7dc4ae7a63c7900b7b2d5a877c0d567345bcd1 /contrib/xxhash | |
parent | 54e5fae2bbea0086c7dd7951bb8776c3672fedf4 (diff) |
libglusterfs/src/dict.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible
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.
In some cases, also changed allocation size to be sizeof some
struct or type instead of a pointer - easier to read.
In some cases, removed redundant strlen() calls by saving the result
into a variable.
1. Only done for the straightforward cases. There's room for improvement.
2. Please review carefully, especially for string allocation, with the
terminating NULL string.
Only compile-tested!
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: Iea9098b9ec0a82a866fbc5836514b1b317daefa1
Diffstat (limited to 'contrib/xxhash')
0 files changed, 0 insertions, 0 deletions