Skip to content

Commit 944d9fc

Browse files
Merge pull request #302 from sebrockm/fix-conversion-warning
Fix conversion warning
2 parents 5f4ce09 + 446dc15 commit 944d9fc

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

include/boost/graph/transitive_closure.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void transitive_closure(const Graph& g, GraphTC& tc,
8282
iterator_property_map< cg_vertex*, VertexIndexMap, cg_vertex, cg_vertex& >
8383
component_number(&component_number_vec[0], index_map);
8484

85-
int num_scc
85+
const cg_vertex num_scc
8686
= strong_components(g, component_number, vertex_index_map(index_map));
8787

8888
std::vector< std::vector< vertex > > components;
@@ -107,12 +107,11 @@ void transitive_closure(const Graph& g, GraphTC& tc,
107107
}
108108
}
109109
std::sort(adj.begin(), adj.end());
110-
typename std::vector< cg_vertex >::iterator di
110+
const typename std::vector< cg_vertex >::iterator di
111111
= std::unique(adj.begin(), adj.end());
112-
if (di != adj.end())
113-
adj.erase(di, adj.end());
112+
114113
for (typename std::vector< cg_vertex >::const_iterator i = adj.begin();
115-
i != adj.end(); ++i)
114+
i != di; ++i)
116115
{
117116
add_edge(s, *i, CG);
118117
}

0 commit comments

Comments
 (0)