mirror of
https://github.com/boostorg/container.git
synced 2025-08-03 14:34:27 +02:00
Use "insert_after" instead of "insert" to avoid unneeded checks.
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user