From 4dc3df6b6b63df1890b1b7c86e625b76201dbd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 3 Jan 2014 10:37:09 +0100 Subject: [PATCH] Use "insert_after" instead of "insert" to avoid unneeded checks. --- include/boost/container/slist.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index 96ac2f6..3620302 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -313,7 +313,7 @@ class slist this->icont().swap(x.icont()); } else{ - this->insert(this->cbegin(), x.begin(), x.end()); + this->insert_after(this->cbefore_begin(), x.begin(), x.end()); } } @@ -1465,10 +1465,10 @@ class slist private: void priv_push_front (const T &x) - { this->insert(this->cbegin(), x); } + { this->insert_after(this->cbefore_begin(), x); } void priv_push_front (BOOST_RV_REF(T) x) - { this->insert(this->cbegin(), ::boost::move(x)); } + { this->insert_after(this->cbefore_begin(), ::boost::move(x)); } bool priv_try_shrink(size_type new_size, const_iterator &last_pos) {