Boost logo

Boost :

From: Janusz Piwowarski (jpiw_at_[hidden])
Date: 2003-08-30 07:57:53


Hi all,

I think is unnecessary to test _is_default_param_;
dispatch*<detail::error_property_not_found> functions are
called when there isn't default parameter.

-- 
Regards, 
Janusz
--- edmunds_karp_max_flow.hpp.orig      Fri Aug 29 22:15:14 2003
+++ edmunds_karp_max_flow.hpp   Sat Aug 30 12:46:40 2003
@@ -164,11 +164,7 @@
        const bgl_named_params<P, T, R>& params,
        detail::error_property_not_found)
       {
-        typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
-        typedef typename graph_traits<Graph>::vertices_size_type size_type;
-        size_type n = is_default_param(get_param(params, vertex_color)) ?
-          num_vertices(g) : 1;
-        std::vector<default_color_type> color_vec(n);
+        std::vector<default_color_type> color_vec(num_vertices(g));
         return edmunds_karp_max_flow
           (g, src, sink, 
            choose_const_pmap(get_param(params, edge_capacity), g, edge_capacity),
@@ -214,10 +210,7 @@
        detail::error_property_not_found)
       {
         typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
-        typedef typename graph_traits<Graph>::vertices_size_type size_type;
-        size_type n = is_default_param(get_param(params, vertex_predecessor)) ?
-          num_vertices(g) : 1;
-        std::vector<edge_descriptor> pred_vec(n);
+        std::vector<edge_descriptor> pred_vec(num_vertices(g));
         
         typedef typename property_value< bgl_named_params<P,T,R>, vertex_color_t>::type C;
         return edmunds_karp_dispatch2<C>::apply

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk