+PODArray::resize_assume_reserved

This commit is contained in:
Andrey Mironov 2014-08-28 15:59:41 +04:00
parent 7039a8b883
commit 771dada9c0
2 changed files with 6 additions and 1 deletions

View File

@ -187,7 +187,7 @@ public:
res_offsets.push_back(current_offset);
const auto chars_size_old = res_chars.size();
res_chars.resize(chars_size_old + size);
res_chars.resize_assume_reserved(chars_size_old + size);
memcpy(&res_chars[chars_size_old], &chars[offset], size);
};

View File

@ -211,6 +211,11 @@ public:
void resize(size_t n)
{
reserve(n);
resize_assume_reserved(n);
}
void resize_assume_reserved(const size_t n)
{
c_end = c_start + byte_size(n);
}