diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-01 03:17:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-01 03:17:32 +0300 |
commit | a69e5c234834ede518effb9f8b18a8968e55d297 (patch) | |
tree | af607fadff91d67a04f117140726cde75fff2783 /source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc | |
parent | 95055af668337cbb07dbb2a0bb0b0adafdc39351 (diff) |
Cleanup: Avoid assigning constructed VArray to reference
This is clearer about what is actually happening (VArray is small
enough to be a by-value type and is constructed on demand, while
only the generic virtual array is stored).
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index a7404af8564..be7b3446125 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -223,8 +223,8 @@ template<typename T> class AccumulateFieldInput final : public GeometryFieldInpu evaluator.add(input_); evaluator.add(group_index_); evaluator.evaluate(); - const VArray<T> &values = evaluator.get_evaluated<T>(0); - const VArray<int> &group_indices = evaluator.get_evaluated<int>(1); + const VArray<T> values = evaluator.get_evaluated<T>(0); + const VArray<int> group_indices = evaluator.get_evaluated<int>(1); Array<T> accumulations_out(domain_num); @@ -309,8 +309,8 @@ template<typename T> class TotalFieldInput final : public GeometryFieldInput { evaluator.add(input_); evaluator.add(group_index_); evaluator.evaluate(); - const VArray<T> &values = evaluator.get_evaluated<T>(0); - const VArray<int> &group_indices = evaluator.get_evaluated<int>(1); + const VArray<T> values = evaluator.get_evaluated<T>(0); + const VArray<int> group_indices = evaluator.get_evaluated<int>(1); if (group_indices.is_single()) { T accumulation = T(); |