wsd: set vector size when constructing

Change-Id: I68718554017b47b6df1c6bf3b997483d4c753136
Reviewed-on: https://gerrit.libreoffice.org/71021
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian 2019-04-20 14:10:38 -04:00 committed by Ashod Nakashian
parent ce78fec310
commit c053dc38b2

View file

@ -29,8 +29,10 @@
#include <climits>
#include <condition_variable>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <memory>
#include <string>
#include <sstream>
#include <thread>
@ -1102,8 +1104,7 @@ public:
LOG_TRC("Sending back painted tiles for " << tileMsg << " of size " << output.size() << " bytes) for: " << tileMsg);
std::shared_ptr<std::vector<char>> response = std::make_shared<std::vector<char>>();
response->resize(tileMsg.size() + output.size());
std::shared_ptr<std::vector<char>> response = std::make_shared<std::vector<char>>(tileMsg.size() + output.size());
std::copy(tileMsg.begin(), tileMsg.end(), response->begin());
std::copy(output.begin(), output.end(), response->begin() + tileMsg.size());