diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-27 23:34:29 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-27 23:41:32 +0300 |
commit | ff048f5d27c4b785f5d6807eb14416ff308ca5ef (patch) | |
tree | 46f0186dcac47acfe002146e202d17acc4338bf0 /source/blender/editors | |
parent | 165fa9e2a1ed6271810c6c0d40822acb0c30c65c (diff) |
Curves: Avoid virtual function overhead when finding selected curves
This showed up on a profile of sculpting with the comb brush.
Use a span instead of a virtual array.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/curves_sculpt_selection.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc b/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc index 5bfc8ccc667..a955a074df2 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc @@ -67,10 +67,11 @@ static IndexMask retrieve_selected_curves(const CurvesGeometry &curves, return selection.get_internal_single() <= 0.0f ? IndexMask(0) : IndexMask(curves.curves_num()); } + const Span<float> point_selection_span = selection.get_internal_span(); return index_mask_ops::find_indices_based_on_predicate( curves.curves_range(), 512, r_indices, [&](const int curve_i) { for (const int i : curves.points_for_curve(curve_i)) { - if (selection[i] > 0.0f) { + if (point_selection_span[i] > 0.0f) { return true; } } |