forked from qt-creator/qt-creator
Lua: Cleanup code style
Change-Id: I7d8713c87a097f113c5b9d04104f3948b691dbf9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -162,17 +162,13 @@ sol::table LuaEngine::toTable(const sol::state_view &lua, const QJsonValue &v)
|
|||||||
|
|
||||||
if (v.isObject()) {
|
if (v.isObject()) {
|
||||||
QJsonObject o = v.toObject();
|
QJsonObject o = v.toObject();
|
||||||
|
for (auto it = o.constBegin(); it != o.constEnd(); ++it)
|
||||||
for (auto it = o.constBegin(); it != o.constEnd(); ++it) {
|
setFromJson(table, it.key(), it.value());
|
||||||
setFromJson(table, it.key().toStdString(), it.value());
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (v.isArray()) {
|
} else if (v.isArray()) {
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (const auto &v : v.toArray()) {
|
for (const auto &v : v.toArray())
|
||||||
setFromJson(table, i++, v);
|
setFromJson(table, i++, v);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user