Skip to content

Commit b27576b

Browse files
authored
clang-tiddy: add cppcoreguidelines-interfaces-global-init (#3004)
1 parent e06c177 commit b27576b

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

include/cpp_common/path.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ class Path {
5959
std::deque< Path_t > path;
6060
int64_t m_start_id;
6161
int64_t m_end_id;
62-
double m_tot_cost;
62+
double m_tot_cost{0};
6363

6464
public:
65-
Path(): m_start_id(0), m_end_id(0), m_tot_cost(0)
65+
Path() : m_start_id(0), m_end_id(0)
6666
{}
6767
Path(int64_t s_id, int64_t e_id)
68-
: m_start_id(s_id), m_end_id(e_id), m_tot_cost(0)
68+
: m_start_id(s_id), m_end_id(e_id)
6969
{}
7070

7171
int64_t start_id() const {return m_start_id;}
@@ -178,8 +178,7 @@ class Path {
178178
const Path &original,
179179
bool only_cost) :
180180
m_start_id(original.m_start_id),
181-
m_end_id(original.m_end_id),
182-
m_tot_cost(0) {
181+
m_end_id(original.m_end_id) {
183182
if (original.path.empty()) return;
184183

185184
typename G::EO_i ei, ei_end;

src/max_flow/minCostMaxFlow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ PgrCostFlowGraph::GetFlowEdges() const {
145145
if (((capacity[*e] - residual_capacity[*e]) > 0) &&
146146
((*e).m_source != supersource) &&
147147
((*e).m_target != supersink)) {
148-
Flow_t edge;
148+
Flow_t edge{};
149149
edge.edge = GetEdgeId(*e);
150150
edge.source = GetVertexId((*e).m_source);
151151
edge.target = GetVertexId((*e).m_target);

0 commit comments

Comments
 (0)