diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index cb8f502..bfa5302 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3842,6 +3842,7 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std the container must be partitioned in regards to the passed comparison object. * Fixed bugs: * [@https://svn.boost.org/trac/boost/ticket/11701 Boost Trac #11701: ['Regression in boost::intrusive::set::equal_range]] + * [@https://svn.boost.org/trac/boost/ticket/11765 Boost Trac #11765: ['sgtree.hpp:830: bad if test ?]] [endsect] diff --git a/include/boost/intrusive/sgtree.hpp b/include/boost/intrusive/sgtree.hpp index dc84c80..b4c4cde 100644 --- a/include/boost/intrusive/sgtree.hpp +++ b/include/boost/intrusive/sgtree.hpp @@ -826,18 +826,17 @@ class sgtree_impl //! Complexity: Linear to the elements in the subtree. void balance_factor(float new_alpha) { - BOOST_INTRUSIVE_INVARIANT_ASSERT((new_alpha > 0.5f && new_alpha < 1.0f)); - if(new_alpha < 0.5f && new_alpha >= 1.0f) return; - //The alpha factor CAN't be changed if the fixed, floating operation-less //1/sqrt(2) alpha factor option is activated BOOST_STATIC_ASSERT((floating_point)); - float old_alpha = this->get_alpha_traits().get_alpha(); - this->get_alpha_traits().set_alpha(new_alpha); - - if(new_alpha < old_alpha){ - this->max_tree_size_ = this->size(); - this->rebalance(); + BOOST_INTRUSIVE_INVARIANT_ASSERT((new_alpha > 0.5f && new_alpha < 1.0f)); + if(new_alpha >= 0.5f && new_alpha < 1.0f){ + float old_alpha = this->get_alpha_traits().get_alpha(); + this->get_alpha_traits().set_alpha(new_alpha); + if(new_alpha < old_alpha){ + this->max_tree_size_ = this->size(); + this->rebalance(); + } } }