diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-04 14:46:41 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-04 14:55:13 +0300 |
commit | 16011e34f08e9a84d9685cdd2a6818c93443d873 (patch) | |
tree | 2cb424d4c95a946c827a83cd8a44fbd4668cde0e /source/blender/blenkernel/intern/curves_geometry.cc | |
parent | 7d7047058a5d84f915ae93a65eb5270322203519 (diff) |
Curves: Optimize filling all curves with a single type
If all curves are selected for setting the new type,
skip counting the types and just set it directly.
Diffstat (limited to 'source/blender/blenkernel/intern/curves_geometry.cc')
-rw-r--r-- | source/blender/blenkernel/intern/curves_geometry.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index 3ec5ee928f4..36ea7a3888f 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -250,6 +250,10 @@ void CurvesGeometry::fill_curve_types(const CurveType type) void CurvesGeometry::fill_curve_types(const IndexMask selection, const CurveType type) { + if (selection.size() == this->curves_num()) { + this->fill_curve_types(type); + return; + } /* A potential performance optimization is only counting the changed indices. */ this->curve_types_for_write().fill_indices(selection, type); this->update_curve_types(); |