Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-29 01:50:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-29 01:50:25 +0400
commit94e5e2f5d811396f608045ab35f77437290f5759 (patch)
treee7bcf2707d2bfcb5515bb53a6df00410c1362e71 /source/blender/makesrna/intern/rna_fcurve.c
parenta91c4ac99fd4d766834a42ace4a670dfa824813b (diff)
Code cleanup: simplify reallocs using MEM_recalloc
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c11
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;