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:
Miklos Vajna 2017-07-05 11:22:06 +02:00
parent 3e6680209e
commit c07efecdcf

View file

@ -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);