Usage modern C++ features on JSON modules (enhanced) (#4613)

This commit is contained in:
Matej Kenda
2024-07-25 18:18:37 +02:00
committed by GitHub
parent 891c1e03bf
commit 5117e27515
19 changed files with 286 additions and 368 deletions

View File

@@ -37,9 +37,7 @@ Query::Query(const Var& source): _source(source)
}
Query::~Query()
{
}
Query::~Query() = default;
Object::Ptr Query::findObject(const std::string& path) const
@@ -51,7 +49,7 @@ Object::Ptr Query::findObject(const std::string& path) const
else if (result.type() == typeid(Object))
return new Object(result.extract<Object>());
return 0;
return nullptr;
}
@@ -79,7 +77,7 @@ Array::Ptr Query::findArray(const std::string& path) const
else if (result.type() == typeid(Array))
return new Array(result.extract<Array>());
return 0;
return nullptr;
}
@@ -150,7 +148,7 @@ Var Query::find(const std::string& path) const
if (!result.isEmpty() && !indexes.empty())
{
for (auto i: indexes)
for (const auto& i: indexes)
{
if (result.type() == typeid(Array::Ptr))
{