diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-29 01:50:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-29 01:50:25 +0400 |
commit | 94e5e2f5d811396f608045ab35f77437290f5759 (patch) | |
tree | e7bcf2707d2bfcb5515bb53a6df00410c1362e71 /source/blender/makesrna | |
parent | a91c4ac99fd4d766834a42ace4a670dfa824813b (diff) |
Code cleanup: simplify reallocs using MEM_recalloc
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 00caa3ba711..0c5c68e4588 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -746,15 +746,8 @@ static void rna_FKeyframe_points_add(FCurve *fcu, int tot) { if (tot > 0) { BezTriple *bezt; - if (fcu->totvert) { - BezTriple *nbezt = MEM_callocN(sizeof(BezTriple) * (fcu->totvert + tot), "rna_FKeyframe_points_add"); - memcpy(nbezt, fcu->bezt, sizeof(BezTriple) * fcu->totvert); - MEM_freeN(fcu->bezt); - fcu->bezt = nbezt; - } - else { - fcu->bezt = MEM_callocN(sizeof(BezTriple) * tot, "rna_FKeyframe_points_add"); - } + + fcu->bezt = MEM_recallocN(fcu->bezt, sizeof(BezTriple) * (fcu->totvert + tot)); bezt = fcu->bezt + fcu->totvert; fcu->totvert += tot; |