Skip to content

Commit b75f6d3

Browse files
submit to clang-tidy
Signed-off-by: Jerry Guo <Jerry.Jinfeng.Guo@alliander.com>
1 parent 046ad98 commit b75f6d3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ struct TrafoGraphEdge {
5050
Idx2D regulated_idx{};
5151
EdgeWeight weight{};
5252

53+
constexpr TrafoGraphEdge() = default;
54+
constexpr TrafoGraphEdge(Idx2D regulated_idx_, EdgeWeight weight_)
55+
: regulated_idx{regulated_idx_}, weight{weight_} {}
56+
5357
bool operator==(const TrafoGraphEdge& other) const {
5458
return regulated_idx == other.regulated_idx && weight == other.weight;
5559
} // thanks boost
@@ -65,7 +69,7 @@ struct TrafoGraphEdge {
6569
}
6670
};
6771

68-
constexpr TrafoGraphEdge unregulated_edge_prop = {unregulated_idx, 0};
72+
constexpr auto unregulated_edge_prop = TrafoGraphEdge{unregulated_idx, 0};
6973
using TrafoGraphEdges = std::vector<std::pair<TrafoGraphIdx, TrafoGraphIdx>>;
7074
using TrafoGraphEdgeProperties = std::vector<TrafoGraphEdge>;
7175

@@ -330,8 +334,7 @@ inline auto get_edge_weights(TransformerGraph const& graph) -> TrafoGraphEdgePro
330334
"away from the source than the tap side.\n");
331335
}
332336
if (!is_unreachable(edge_res)) {
333-
result.emplace_back(
334-
TrafoGraphEdge{graph[e].regulated_idx, edge_tgt_rank}); // NOLINT(clang-diagnostic-error, other-warning)
337+
result.emplace_back(graph[e].regulated_idx, edge_tgt_rank);
335338
}
336339
}
337340

0 commit comments

Comments
 (0)