[Libreoffice-commits] online.git: loolwsd/MasterProcessSession.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Thu Apr 14 06:37:17 UTC 2016
loolwsd/MasterProcessSession.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 63d911297746e84b8996348e85f15db5c82f2cee
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Apr 14 08:36:56 2016 +0200
MasterProcessSession: const auto -> const auto& where it would create a tmp copy
Change-Id: I5bbffb9be562b52f868bfca3f825e8d81dae4eef
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index e67b332..9f3763a 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -134,13 +134,13 @@ bool MasterProcessSession::_handleInput(const char *buffer, int length)
{
const std::string stringMsg(buffer, length);
Log::info(getName() + "Command: " + stringMsg);
- const auto index = stringMsg.find_first_of("{");
+ const auto index = stringMsg.find_first_of('{');
if (index != std::string::npos)
{
const std::string stringJSON = stringMsg.substr(index);
Poco::JSON::Parser parser;
const auto result = parser.parse(stringJSON);
- const auto object = result.extract<Poco::JSON::Object::Ptr>();
+ const auto& object = result.extract<Poco::JSON::Object::Ptr>();
if (object->get("commandName").toString() == ".uno:Save" &&
object->get("success").toString() == "true")
{
@@ -233,13 +233,13 @@ bool MasterProcessSession::_handleInput(const char *buffer, int length)
else if (tokens[0] == "commandvalues:")
{
const std::string stringMsg(buffer, length);
- const auto index = stringMsg.find_first_of("{");
+ const auto index = stringMsg.find_first_of('{');
if (index != std::string::npos)
{
const std::string stringJSON = stringMsg.substr(index);
Poco::JSON::Parser parser;
const auto result = parser.parse(stringJSON);
- const auto object = result.extract<Poco::JSON::Object::Ptr>();
+ const auto& object = result.extract<Poco::JSON::Object::Ptr>();
const std::string commandName = object->get("commandName").toString();
if (commandName.find(".uno:CharFontName") != std::string::npos ||
commandName.find(".uno:StyleApply") != std::string::npos)
More information about the Libreoffice-commits
mailing list