Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80264 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2012-08-27 15:05:25


Author: jewillco
Date: 2012-08-27 15:05:25 EDT (Mon, 27 Aug 2012)
New Revision: 80264
URL: http://svn.boost.org/trac/boost/changeset/80264

Log:
Made edge weight a reference based on a suggestion by Tristram Gräbener; made vertex distance variables const values
Text files modified:
   trunk/boost/graph/relax.hpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: trunk/boost/graph/relax.hpp
==============================================================================
--- trunk/boost/graph/relax.hpp (original)
+++ trunk/boost/graph/relax.hpp 2012-08-27 15:05:25 EDT (Mon, 27 Aug 2012)
@@ -49,8 +49,9 @@
       Vertex u = source(e, g), v = target(e, g);
       typedef typename property_traits<DistanceMap>::value_type D;
       typedef typename property_traits<WeightMap>::value_type W;
- D d_u = get(d, u), d_v = get(d, v);
- W w_e = get(w, e);
+ const D d_u = get(d, u);
+ const D d_v = get(d, v);
+ const W& w_e = get(w, e);
       
       // The redundant gets in the return statements are to ensure that extra
       // floating-point precision in x87 registers does not lead to relax()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk