dd: simplify code
This commit is contained in:
parent
9f2b175502
commit
5d0795dbd0
|
@ -321,12 +321,11 @@ void DataDragon::getChampsInternal() {
|
||||||
|
|
||||||
QJsonObject obj = jchamps.object();
|
QJsonObject obj = jchamps.object();
|
||||||
auto it = obj.constFind("data");
|
auto it = obj.constFind("data");
|
||||||
if(it != obj.constEnd() && it.value().isObject()) {
|
if(it != obj.constEnd() && it->isObject()) {
|
||||||
QJsonObject jchampsdata = it.value().toObject();
|
for(auto&& champdata : it->toObject()) {
|
||||||
for(auto champit = jchampsdata.constBegin(); champit != jchampsdata.constEnd(); champit++) {
|
if(champdata.isObject()) {
|
||||||
if(champit.value().isObject()) {
|
auto& dataobj = champs.emplace_back(champdata.toObject());
|
||||||
champs.emplace_back(champit.value().toObject());
|
notDownloadedImages.insert(dataobj.id);
|
||||||
notDownloadedImages.insert(champs.back().id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue