[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jul 18 08:33:22 UTC 2016
loolwsd/DocumentBroker.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 24624762dff23957c2b82e0416e0ab9f43b1ca71
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jul 18 10:25:05 2016 +0200
DocumentBroker: use std::move() instead of manual reset()/release()
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index d0c21f2..052ef0c 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -105,7 +105,7 @@ DocumentBroker::DocumentBroker(const Poco::URI& uriPublic,
_docKey(docKey),
_childRoot(childRoot),
_cacheRoot(getCachePath(uriPublic.toString())),
- _childProcess(childProcess),
+ _childProcess(std::move(childProcess)),
_lastSaveTime(std::chrono::steady_clock::now()),
_markToDestroy(false),
_lastEditableSession(false),
@@ -181,7 +181,7 @@ bool DocumentBroker::load(const std::string& jailId)
_lastFileModifiedTime = Poco::File(storage->getLocalRootPath()).getLastModified();
_tileCache.reset(new TileCache(_uriPublic.toString(), _lastFileModifiedTime, _cacheRoot));
- _storage.reset(storage.release());
+ _storage = std::move(storage);
return true;
}
@@ -482,7 +482,7 @@ void DocumentBroker::handleTileRequest(TileDesc& tile,
#endif
std::vector<char> output;
- output.reserve(4 * tile.getWidth() * tile.getHeight());
+ output.reserve(static_cast<size_t>(4) * tile.getWidth() * tile.getHeight());
output.resize(response.size());
std::memcpy(output.data(), response.data(), response.size());
@@ -533,7 +533,7 @@ void DocumentBroker::handleTileCombinedRequest(TileCombined& tileCombined,
#endif
std::vector<char> output;
- output.reserve(4 * tile.getWidth() * tile.getHeight());
+ output.reserve(static_cast<size_t>(4) * tile.getWidth() * tile.getHeight());
output.resize(response.size());
std::memcpy(output.data(), response.data(), response.size());
More information about the Libreoffice-commits
mailing list