commit | 9495507225bef50c139a89daf000fc161f9c1227 | [log] [tgz] |
---|---|---|
author | Radek Krejci <rkrejci@cesnet.cz> | Wed May 22 15:28:29 2019 +0200 |
committer | Radek Krejci <rkrejci@cesnet.cz> | Wed May 22 15:28:29 2019 +0200 |
tree | 6cdf75811d45621124038d821db29db7204b5f25 | |
parent | 2fb5e06081e6b313ccf4f4c02d2739031e7a49e5 [diff] [blame] |
set CHANGE small optimization of ly_set_dup()
diff --git a/src/set.c b/src/set.c index b858491..3b7f078 100644 --- a/src/set.c +++ b/src/set.c
@@ -102,7 +102,7 @@ new = malloc(sizeof *new); LY_CHECK_ERR_RET(!new, LOGMEM(NULL), NULL); new->count = set->count; - new->size = set->size; + new->size = set->count; /* optimize the size */ new->objs = malloc(new->size * sizeof *(new->objs)); LY_CHECK_ERR_RET(!new->objs, LOGMEM(NULL); free(new), NULL); if (duplicator) {