wsd: avoid string concatenation resulting in allocation of unnecessary temporary strings in FileServer
By using operator+= instead, which does not have this problem. Change-Id: I6dd54cde7e430f2f1d549642dddd3ed1a0e9eefd
This commit is contained in:
parent
3e6680209e
commit
c07efecdcf
1 changed files with 2 additions and 2 deletions
|
@ -376,8 +376,8 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
|
|||
const long unsigned int haveComp = compSize - strm.avail_out;
|
||||
std::string partialcompFile(cbuf, haveComp);
|
||||
std::string partialuncompFile(buf.get(), size);
|
||||
compressedFile = compressedFile + partialcompFile;
|
||||
uncompressedFile = uncompressedFile + partialuncompFile;
|
||||
compressedFile += partialcompFile;
|
||||
uncompressedFile += partialuncompFile;
|
||||
free(cbuf);
|
||||
|
||||
} while(true);
|
||||
|
|
Loading…
Reference in a new issue