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.
This commit is contained in:
Hans Goudey 2022-05-04 13:46:41 +02:00
parent 7d7047058a
commit 16011e34f0
1 changed files with 4 additions and 0 deletions

View File

@ -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();