Cleanup: Remove unnecessary dynamic_cast in simulation state creation #107796
|
@ -178,15 +178,10 @@ void simulation_state_to_values(const Span<NodeSimulationItem> node_simulation_i
|
|||
|
||||
switch (socket_type) {
|
||||
case SOCK_GEOMETRY: {
|
||||
if (const auto *geo_state_item =
|
||||
dynamic_cast<const bke::sim::GeometrySimulationStateItem *>(&state_item))
|
||||
{
|
||||
GeometrySet *geometry = new (r_output_value) GeometrySet(geo_state_item->geometry);
|
||||
geometries.append(geometry);
|
||||
}
|
||||
else {
|
||||
cpp_type.value_initialize(r_output_value);
|
||||
}
|
||||
const auto &geo_state_item = static_cast<const bke::sim::GeometrySimulationStateItem &>(
|
||||
state_item);
|
||||
GeometrySet *geometry = new (r_output_value) GeometrySet(geo_state_item.geometry);
|
||||
geometries.append(geometry);
|
||||
break;
|
||||
}
|
||||
case SOCK_FLOAT:
|
||||
|
@ -228,14 +223,9 @@ void simulation_state_to_values(const Span<NodeSimulationItem> node_simulation_i
|
|||
break;
|
||||
}
|
||||
case SOCK_STRING: {
|
||||
if (const auto *string_state_item =
|
||||
dynamic_cast<const bke::sim::StringSimulationStateItem *>(&state_item))
|
||||
{
|
||||
new (r_output_value) ValueOrField<std::string>(string_state_item->value());
|
||||
}
|
||||
else {
|
||||
cpp_type.value_initialize(r_output_value);
|
||||
}
|
||||
const auto &string_state_item = static_cast<const bke::sim::StringSimulationStateItem &>(
|
||||
state_item);
|
||||
new (r_output_value) ValueOrField<std::string>(string_state_item.value());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Reference in New Issue