Skip to content

Commit f8cc1f4

Browse files
committed
fix sonar reliability issue
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
1 parent 9012de5 commit f8cc1f4

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

  • power_grid_model_c/power_grid_model/include/power_grid_model

power_grid_model_c/power_grid_model/include/power_grid_model/topology.hpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -344,48 +344,6 @@ class Topology {
344344
return fill_in;
345345
}
346346

347-
// TODO(mgovers): remove this before merge!!!!!
348-
void reproduce_issue() {
349-
std::vector<int> v1{1, 2, 3, 4, 5};
350-
std::vector<int> v2{6, 7, 8, 9, 10};
351-
std::string dummy;
352-
353-
// Versions with modifying: should raise sonar cloud warnings
354-
for (auto const& t : std::views::zip(v1, v2)) {
355-
get<0>(t) = get<1>(t); // Compiles
356-
dummy += std::to_string(get<0>(t)); // Compiles and warns
357-
}
358-
for (auto&& t : std::views::zip(v1, v2)) {
359-
get<0>(t) = get<1>(t); // Compiles
360-
dummy += std::to_string(get<0>(t)); // Compiles and warns
361-
}
362-
for (auto const& [t1, t2] : std::views::zip(v1, v2)) {
363-
t1 = t2; // Compiles
364-
dummy += std::to_string(t1); // Compiles and warns
365-
}
366-
for (auto&& [t1, t2] : std::views::zip(v1, v2)) {
367-
t1 = t2; // Compiles
368-
dummy += std::to_string(t1); // Compiles and warns
369-
}
370-
// Versions with modifying that do not compile
371-
for (auto const& t : std::views::zip(v1, v2) | std::views::as_const) {
372-
// get<0>(t) = get<1>(t); // Does not compile
373-
dummy += std::to_string(get<0>(t)); // Compiles and warns
374-
}
375-
for (auto&& t : std::views::zip(v1, v2) | std::views::as_const) {
376-
// get<0>(t) = get<1>(t); // Does not compile
377-
dummy += std::to_string(get<0>(t)); // Compiles and warns
378-
}
379-
for (auto const& t : std::views::zip(std::as_const(v1), std::as_const(v2))) {
380-
// get<0>(t) = get<1>(t); // Does not compile
381-
dummy += std::to_string(get<0>(t)); // Compiles and warns
382-
}
383-
for (auto&& t : std::views::zip(std::as_const(v1), std::as_const(v2))) {
384-
// get<0>(t) = get<1>(t); // Does not compile
385-
dummy += std::to_string(get<0>(t)); // Compiles and warns
386-
}
387-
}
388-
389347
void couple_branch() {
390348
auto const get_group_pos_if = []([[maybe_unused]] Idx math_group, IntS status, Idx2D const& math_idx) {
391349
if (status == 0) {

0 commit comments

Comments
 (0)