mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-17 14:19:40 +08:00
refactor: use for instead of forEach
This commit is contained in:
parent
896680c80b
commit
fb1ea6c8be
1 changed files with 3 additions and 2 deletions
|
|
@ -145,7 +145,8 @@ export async function update(
|
|||
|
||||
const start2 = performance.now();
|
||||
let retval: number | undefined = undefined;
|
||||
lb.forEach((lbEntry, index) => {
|
||||
for (let index = 0; index < lb.length; index++) {
|
||||
const lbEntry = lb[index];
|
||||
lbEntry.rank = index + 1;
|
||||
if (uid && lbEntry.uid === uid) {
|
||||
retval = index + 1;
|
||||
|
|
@ -159,7 +160,7 @@ export async function update(
|
|||
}
|
||||
delete lbEntry.badges;
|
||||
}
|
||||
});
|
||||
}
|
||||
const end2 = performance.now();
|
||||
const start3 = performance.now();
|
||||
leaderboardUpdating[`${language}_${mode}_${mode2}`] = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue