Skip to content

Commit 28204fb

Browse files
committed
sonar
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
1 parent 6ad4848 commit 28204fb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/main_core/update.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,9 @@ get_all_sequence_idx_map(MainModelState<ComponentContainer> const& state, ConstD
227227
// The sequence for the independent components is cached (true). For the remaining components, the sequence
228228
// cannot be cached (false), so the independence flags are inverted to not return an empty sequence when
229229
// this is the case.
230-
bool const component_independence = cached != component_properties.is_independent();
231-
if (!component_independence ||
230+
231+
if (bool const component_independence = cached != component_properties.is_independent();
232+
!component_independence ||
232233
!std::get<utils::index_of_component<CompType, ComponentTypes...>>(components_to_store)) {
233234
return std::vector<Idx2D>{};
234235
}

power_grid_model_c/power_grid_model/include/power_grid_model/main_model_impl.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
557557
state_, update_data, 0, components_to_update, update_independence, false);
558558

559559
return [&base_model, &exceptions, &infos, &calculation_fn, &result_data, &update_data,
560-
&all_scenarios_sequence = std::as_const(all_scenarios_sequence), components_to_update,
560+
&all_scenarios_sequence_ = std::as_const(all_scenarios_sequence), components_to_update,
561561
update_independence](Idx start, Idx stride, Idx n_scenarios) {
562562
assert(n_scenarios <= narrow_cast<Idx>(exceptions.size()));
563563
assert(n_scenarios <= narrow_cast<Idx>(infos.size()));
@@ -573,7 +573,7 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
573573
auto current_scenario_sequence_cache = main_core::utils::SequenceIdx<ComponentType...>{};
574574
auto [setup, winddown] =
575575
scenario_update_restore(model, update_data, components_to_update, update_independence,
576-
all_scenarios_sequence, current_scenario_sequence_cache, infos);
576+
all_scenarios_sequence_, current_scenario_sequence_cache, infos);
577577

578578
auto calculate_scenario = MainModelImpl::call_with<Idx>(
579579
[&model, &calculation_fn, &result_data, &infos](Idx scenario_idx) {

0 commit comments

Comments
 (0)