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