Cleanup: Use std::move and std::nullopt in Accumulate Field Node
The nodes from #134640 were initially built off the Accumulate Field node. During review for those nodes, certain changes to the code were suggested. This patch applies the same changes to Accumulate Field node. These changes namely being: - Use `std::move` for field inputs - Use `std::nullopt` as default for `node_type_from_other_socket` Pull Request: https://projects.blender.org/blender/blender/pulls/137209
This commit is contained in:
@@ -99,7 +99,7 @@ static std::optional<eCustomDataType> node_type_from_other_socket(const bNodeSoc
|
||||
case SOCK_MATRIX:
|
||||
return CD_PROP_FLOAT4X4;
|
||||
default:
|
||||
return {};
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,8 +184,8 @@ class AccumulateFieldInput final : public bke::GeometryFieldInput {
|
||||
Field<int> group_index,
|
||||
AccumulationMode accumulation_mode)
|
||||
: bke::GeometryFieldInput(input.cpp_type(), "Accumulation"),
|
||||
input_(input),
|
||||
group_index_(group_index),
|
||||
input_(std::move(input)),
|
||||
group_index_(std::move(group_index)),
|
||||
source_domain_(source_domain),
|
||||
accumulation_mode_(accumulation_mode)
|
||||
{
|
||||
@@ -292,8 +292,8 @@ class TotalFieldInput final : public bke::GeometryFieldInput {
|
||||
public:
|
||||
TotalFieldInput(const AttrDomain source_domain, GField input, Field<int> group_index)
|
||||
: bke::GeometryFieldInput(input.cpp_type(), "Total Value"),
|
||||
input_(input),
|
||||
group_index_(group_index),
|
||||
input_(std::move(input)),
|
||||
group_index_(std::move(group_index)),
|
||||
source_domain_(source_domain)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user