Lua: Cleanup code style

Change-Id: I7d8713c87a097f113c5b9d04104f3948b691dbf9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-04-23 08:32:50 +02:00
parent fa41cba5c3
commit bc5b67909c

View File

@@ -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;
} }