GPv3: Duplicate operator (edit mode) #115389
@ -1505,9 +1505,10 @@ static bke::CurvesGeometry duplicate_points(const bke::CurvesGeometry &curves,
|
||||
const IndexRange range = ranges_to_duplicate[range_i];
|
||||
|
||||
casey-bianco-davis marked this conversation as resolved
Outdated
|
||||
int count = range.size();
|
||||
for (const int src_point : range.shift(points.first())) {
|
||||
dst_to_src_point[curr_dst_point_id++] = src_point;
|
||||
}
|
||||
array_utils::fill_index_range<int>(
|
||||
casey-bianco-davis marked this conversation as resolved
Outdated
Falk David
commented
We can replace this loop with
We can replace this loop with `fill_index_range` as well.
```
array_utils::fill_index_range<int>(
dst_to_src_point.as_mutable_span().slice(curr_dst_point_id, count),
range.start() + points.first());
curr_dst_point_id += range.size();
```
|
||||
dst_to_src_point.as_mutable_span().slice(curr_dst_point_id, count),
|
||||
range.start() + points.first());
|
||||
curr_dst_point_id += range.size();
|
||||
|
||||
/* Join the first range to the end of the last range. */
|
||||
if (is_curve_self_joined && range_i == range_ids.last()) {
|
||||
casey-bianco-davis marked this conversation as resolved
Falk David
commented
Move this below Move this below `const IndexRange range_ids` ouside of the loop.
|
||||
|
Loading…
Reference in New Issue
Block a user
Use
const
.