Cleanup: Typo, improve variable names
`accumulate_counts_to_offsets` wasn't just used for the point domain.
This commit is contained in:
parent
7ef3a1a6e6
commit
6d61cf4e80
|
@ -22,7 +22,7 @@ inline void convert_to_static_type(const CPPType &cpp_type, const Func &func)
|
|||
[&](auto type_tag) {
|
||||
using T = typename decltype(type_tag)::type;
|
||||
if constexpr (std::is_same_v<T, void>) {
|
||||
/* It's expected that the given cpp type is one of the supported once. */
|
||||
/* It's expected that the given cpp type is one of the supported ones. */
|
||||
BLI_assert_unreachable();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -83,12 +83,12 @@ static Array<int> accumulate_counts_to_offsets(const IndexMask selection,
|
|||
const VArray<int> &counts)
|
||||
{
|
||||
Array<int> offsets(selection.size() + 1);
|
||||
int dst_points_size = 0;
|
||||
for (const int i_point : selection.index_range()) {
|
||||
offsets[i_point] = dst_points_size;
|
||||
dst_points_size += std::max(counts[selection[i_point]], 0);
|
||||
int total = 0;
|
||||
for (const int i : selection.index_range()) {
|
||||
offsets[i] = total;
|
||||
total += std::max(counts[selection[i]], 0);
|
||||
}
|
||||
offsets.last() = dst_points_size;
|
||||
offsets.last() = total;
|
||||
return offsets;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue