Small optimization (!248)
Change `foreach` to use `for of` instead, `for of` is faster than `foreach` Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/248 Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com> Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
96bace1288
commit
2249337a02
@ -887,10 +887,11 @@ export class QuestController
|
||||
childItems.shift(); // Remove the parent
|
||||
|
||||
// Sort by the current `location` and update
|
||||
childItems.sort((a, b) => a.location > b.location ? 1 : -1).forEach((item, index) =>
|
||||
childItems.sort((a, b) => a.location > b.location ? 1 : -1);
|
||||
for (const [index, item] of childItems.entries())
|
||||
{
|
||||
item.location = index;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user