[Bf-blender-cvs] [6d61cf4e80d] master: Cleanup: Typo, improve variable names
Hans Goudey
noreply at git.blender.org
Thu Mar 24 05:50:33 CET 2022
Commit: 6d61cf4e80d03e9c05cbefa78e233a68c9fe0ca4
Author: Hans Goudey
Date: Wed Mar 23 23:50:10 2022 -0500
Branches: master
https://developer.blender.org/rB6d61cf4e80d03e9c05cbefa78e233a68c9fe0ca4
Cleanup: Typo, improve variable names
`accumulate_counts_to_offsets` wasn't just used for the point domain.
===================================================================
M source/blender/blenkernel/BKE_attribute_math.hh
M source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_attribute_math.hh b/source/blender/blenkernel/BKE_attribute_math.hh
index 3075c0689e9..9efa64d1474 100644
--- a/source/blender/blenkernel/BKE_attribute_math.hh
+++ b/source/blender/blenkernel/BKE_attribute_math.hh
@@ -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 {
diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
index da4e99026c3..b85ef07e9fe 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
@@ -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;
}
More information about the Bf-blender-cvs
mailing list