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
This commit is contained in:
parent
a20afc1ceb
commit
01bf6ab344
1 changed files with 1 additions and 1 deletions
|
@ -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 parseJSON(const std::string& json, Poco::JSON::Object::Ptr& object)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
const auto index = json.find_first_of("{");
|
const auto index = json.find_first_of('{');
|
||||||
if (index != std::string::npos)
|
if (index != std::string::npos)
|
||||||
{
|
{
|
||||||
const std::string stringJSON = json.substr(index);
|
const std::string stringJSON = json.substr(index);
|
||||||
|
|
Loading…
Reference in a new issue