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) {
|
||||
responseJson.Scans = allScans;
|
||||
const scans = new Set(allScans);
|
||||
for (const type of Object.keys(ExportEnemies.avatars)) {
|
||||
if (!responseJson.Scans.find(x => x.type == type)) {
|
||||
responseJson.Scans.push({ type, scans: 9999 });
|
||||
if (!scans.has(type)) {
|
||||
scans.add(type);
|
||||
}
|
||||
}
|
||||
responseJson.Scans = [];
|
||||
for (const type of scans) {
|
||||
responseJson.Scans.push({ type: type, scans: 9999 });
|
||||
}
|
||||
}
|
||||
res.json(responseJson);
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user