[Libreoffice-commits] online.git: wsd/Storage.cpp

Miklos Vajna vmiklos at collabora.co.uk
Thu Jul 6 09:17:53 UTC 2017


 wsd/Storage.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 01bf6ab344594402e4797a3d0767d0326b742c88
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jul 6 11:17:19 2017 +0200

    wsd: use the more effective overload accepting a character in Storage
    
    I guess checking for "{" in parseJSON() happens for performance reasons,
    but then it's a good idea to also avoid constructing a temporary string
    for no reason.
    
    Change-Id: I285ba0ed615054fc014796f7d8971a2b9783b075

diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 52fa5e1d..23a2dfdf 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -412,7 +412,7 @@ void getWOPIValue(const Poco::JSON::Object::Ptr &object, const std::string& key,
 bool parseJSON(const std::string& json, Poco::JSON::Object::Ptr& object)
 {
     bool success = false;
-    const auto index = json.find_first_of("{");
+    const auto index = json.find_first_of('{');
     if (index != std::string::npos)
     {
         const std::string stringJSON = json.substr(index);


More information about the Libreoffice-commits mailing list