chore: optimise unlockAllScans
~20ms to ~6ms
This commit is contained in:
parent
9f21696dcf
commit
d56b2cf8ad
@ -23,12 +23,16 @@ const viewController: RequestHandler = async (req, res) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (config.unlockAllScans) {
|
if (config.unlockAllScans) {
|
||||||
responseJson.Scans = allScans;
|
const scans = new Set(allScans);
|
||||||
for (const type of Object.keys(ExportEnemies.avatars)) {
|
for (const type of Object.keys(ExportEnemies.avatars)) {
|
||||||
if (!responseJson.Scans.find(x => x.type == type)) {
|
if (!scans.has(type)) {
|
||||||
responseJson.Scans.push({ type, scans: 9999 });
|
scans.add(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
responseJson.Scans = [];
|
||||||
|
for (const type of scans) {
|
||||||
|
responseJson.Scans.push({ type: type, scans: 9999 });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
res.json(responseJson);
|
res.json(responseJson);
|
||||||
};
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user