Use "insert_after" instead of "insert" to avoid unneeded checks.

This commit is contained in:
Ion Gaztañaga
2014-01-03 10:37:09 +01:00
parent fc8507b48c
commit 4dc3df6b6b

View File

@@ -313,7 +313,7 @@ class slist
this->icont().swap(x.icont()); this->icont().swap(x.icont());
} }
else{ 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: private:
void priv_push_front (const T &x) 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) 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) bool priv_try_shrink(size_type new_size, const_iterator &last_pos)
{ {