Removed reserve(N+1) in buffer_vector. It’s a stupid logic when we have a sequence of push_back or emplace_back calls.

This commit is contained in:
vng 2015-03-27 13:54:12 +03:00 committed by Alex Zolotarev
parent 65251a9d86
commit fd3fbfce5a
2 changed files with 0 additions and 5 deletions

View file

@ -74,12 +74,9 @@ UNIT_TEST(BufferVectorSwap)
TEST_EQUAL ( v1[0][0], 666, () );
TEST_EQUAL ( dd1, v1[0].data(), () );
// resize from 1 to 7 => will push_back v[0] to new place
// (??? but can stay at the same place ???)
v1.resize(7);
TEST_EQUAL ( v1[0].size(), 1, () );
TEST_EQUAL ( v1[0][0], 666, () );
TEST_NOT_EQUAL ( dd1, v1[0].data(), () );
}
{

View file

@ -278,7 +278,6 @@ public:
else
{
ASSERT_EQUAL(m_size, N, ());
m_dynamic.reserve(N + 1);
SwitchToDynamic();
m_dynamic.push_back(t);
ASSERT_EQUAL(m_dynamic.size(), N + 1, ());
@ -297,7 +296,6 @@ public:
else
{
ASSERT_EQUAL(m_size, N, ());
m_dynamic.reserve(N + 1);
SwitchToDynamic();
m_dynamic.push_back(move(t));
ASSERT_EQUAL(m_dynamic.size(), N + 1, ());