Commit 8645b67a authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

vf2_sub_graph_iso.hpp(): avoid uncessary O(N) in get_num_vertices()

parent af64085d
Pipeline #946 passed with stage
in 43 minutes and 17 seconds
......@@ -78,10 +78,9 @@ namespace detail
template <typename Graph>
typename graph_traits<Graph>::vertices_size_type get_num_vertices(Graph& g)
{
typename graph_traits<Graph>::vertices_size_type N = 0;
BGL_FORALL_VERTICES_T(v, g, Graph)
N++;
return N;
typedef typename graph_traits<Graph>::vertex_iterator iter;
std::pair<iter, iter> vs = vertices(g);
return std::distance(vs.first, vs.second);
}
// State associated with a single graph (graph_this)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment