From e2db737d1b01327bdb9d3154ce7bfa3331dada34 Mon Sep 17 00:00:00 2001 From: Rasmus Ahlberg Date: Mon, 30 Jul 2018 12:15:25 +0200 Subject: [PATCH] Don't copy value if not needed, as source's m_property will be set to null when copied. See https://svn.boost.org/trac10/ticket/13544. --- include/boost/graph/detail/adjacency_list.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/boost/graph/detail/adjacency_list.hpp b/include/boost/graph/detail/adjacency_list.hpp index 6fb497d7..a8c92df1 100644 --- a/include/boost/graph/detail/adjacency_list.hpp +++ b/include/boost/graph/detail/adjacency_list.hpp @@ -2058,13 +2058,17 @@ namespace boost { { typename EdgeList::iterator ei = el.begin(), e_end = el.end(); while (ei != e_end) { - typename EdgeList::value_type ce = *ei; - ++ei; - if (ce.get_target() > u) { + if (ei->get_target() > u) { + typename EdgeList::value_type ce = *ei; + ++ei; el.erase(ce); --ce.get_target(); el.insert(ce); } + else + { + ++ei; + } } } } // namespace detail