Currently the code in defvert_remove_group() does a malloc and memcpy where a realloc could be used instead. Since the allocation is always smaller, it can be resized in-place and never need to call an internal memcpy (if MEM_reallocN()'s implementation was to do this in the future). Also added an assert to make sure that the existing array is never null, instead of seeming optional as is. If it is null, the [re]allocated elements would contain garbage.
This revision needs review, but there are no reviewers specified.
Details
Details
- Reviewers
- None
Summary
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Chad Fraleigh (chadf) retitled this revision from to Simplify code in defvert_remove_group() to use realloc.
Chad Fraleigh (chadf) updated this object.