Commit e985a307 authored by Héctor Mesa Jiménez's avatar Héctor Mesa Jiménez Committed by Christoph Cullmann
Browse files

gdbplugin: findVariables' exit conditions

parent 7efddedf
......@@ -251,6 +251,8 @@ QJsonValue resolve(const QJsonValue &value, const VarMap &variables)
void findVariables(const QJsonObject &map, QSet<QString> &variables)
{
if (map.isEmpty())
return;
for (const auto &value : map) {
findVariables(value, variables);
}
......@@ -258,6 +260,8 @@ void findVariables(const QJsonObject &map, QSet<QString> &variables)
void findVariables(const QJsonValue &value, QSet<QString> &variables)
{
if (value.isNull() || value.isUndefined())
return;
if (value.isObject()) {
findVariables(value.toObject(), variables);
} else if (value.isArray()) {
......@@ -269,6 +273,8 @@ void findVariables(const QJsonValue &value, QSet<QString> &variables)
void findVariables(const QJsonArray &array, QSet<QString> &variables)
{
if (array.isEmpty())
return;
for (const auto &value : array) {
findVariables(value, variables);
}
......@@ -276,6 +282,8 @@ void findVariables(const QJsonArray &array, QSet<QString> &variables)
void findVariables(const QString &text, QSet<QString> &variables)
{
if (text.isNull() || text.isEmpty())
return;
auto matches = rx_placeholder.globalMatch(text);
while (matches.hasNext()) {
const auto match = matches.next();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment