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;
|
const long unsigned int haveComp = compSize - strm.avail_out;
|
||||||
std::string partialcompFile(cbuf, haveComp);
|
std::string partialcompFile(cbuf, haveComp);
|
||||||
std::string partialuncompFile(buf.get(), size);
|
std::string partialuncompFile(buf.get(), size);
|
||||||
compressedFile = compressedFile + partialcompFile;
|
compressedFile += partialcompFile;
|
||||||
uncompressedFile = uncompressedFile + partialuncompFile;
|
uncompressedFile += partialuncompFile;
|
||||||
free(cbuf);
|
free(cbuf);
|
||||||
|
|
||||||
} while(true);
|
} while(true);
|
||||||
|
|
Loading…
Reference in a new issue