Skip to content

Commit f7c64c9

Browse files
committed
minor
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
1 parent 5767a9a commit f7c64c9

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,18 @@ template <typename CompType> void process_buffer_span(auto const& all_spans, Upd
9595
if (all_spans.empty()) {
9696
properties.update_ids_match = true;
9797
return;
98-
} else {
99-
// Remember the begin iterator of the first scenario, then loop over the remaining scenarios and
100-
// check the ids
101-
auto const first_span = all_spans[0];
102-
// check the subsequent scenarios
103-
// only return true if all scenarios match the ids of the first batch
104-
properties.update_ids_match =
105-
std::ranges::all_of(all_spans.cbegin() + 1, all_spans.cend(), [&first_span](auto const& current_span) {
106-
return std::ranges::equal(
107-
current_span, first_span,
108-
[](typename CompType::UpdateType const& obj, typename CompType::UpdateType const& first) {
109-
return obj.id == first.id;
110-
});
111-
});
11298
}
99+
// Remember the begin iterator of the first scenario, then loop over the remaining scenarios and
100+
// check the ids
101+
auto const first_span = all_spans[0];
102+
// check the subsequent scenarios
103+
// only return true if all scenarios match the ids of the first batch
104+
properties.update_ids_match =
105+
std::ranges::all_of(all_spans.cbegin() + 1, all_spans.cend(), [&first_span](auto const& current_span) {
106+
return std::ranges::equal(current_span, first_span,
107+
[](typename CompType::UpdateType const& obj,
108+
typename CompType::UpdateType const& first) { return obj.id == first.id; });
109+
});
113110
}
114111

115112
template <class CompType>

tests/cpp_unit_tests/test_tap_position_optimizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,8 @@ TEST_CASE("Test Tap position optimizer") {
691691
auto const& transformers_dataset =
692692
update_dataset.get_buffer_span<meta_data::update_getter_s, MockTransformer>();
693693
auto changed_components = std::vector<Idx2D>{};
694-
main_core::update_component<MockTransformer>(state, transformers_dataset.begin(), transformers_dataset.end(),
695-
std::back_inserter(changed_components));
694+
main_core::update::update_component<MockTransformer>(
695+
state, transformers_dataset.begin(), transformers_dataset.end(), std::back_inserter(changed_components));
696696
};
697697

698698
auto twoStatesEqual = [](const MockState& state1, const MockState& state2) {

0 commit comments

Comments
 (0)