Fixed not-an-issue found by Coverity [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-09-11 08:51:15 +03:00
parent 3f9d7ed44e
commit 9cafeb9e85
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ private:
{
size_t old_size = s.size();
s.resize(old_size * 2);
internal_buffer = Buffer(reinterpret_cast<Position>(&s[old_size]), reinterpret_cast<Position>(&*s.end()));
internal_buffer = Buffer(reinterpret_cast<Position>(&s[old_size]), reinterpret_cast<Position>(&s[s.size()]));
working_buffer = internal_buffer;
}

View File

@ -24,7 +24,7 @@ private:
{
size_t old_size = vector.size();
vector.resize(old_size * 2);
internal_buffer = Buffer(reinterpret_cast<Position>(&vector[old_size]), reinterpret_cast<Position>(&*vector.end()));
internal_buffer = Buffer(reinterpret_cast<Position>(&vector[old_size]), reinterpret_cast<Position>(vector.data() + vector.size()));
working_buffer = internal_buffer;
}