You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a couple of things that can be done to optimize the code:
Reduce unnecessary usage of forEach and using map and flat instead. It's faster to generate an array in one pass with map than to use forEach to push into an array.
Avoid calling PopulationUtils.getTeamNameFromId() in each iteration when the teamID doesn't change frequently. Cache the team names in a Map where the key is the teamID and the value is the team name.
Use a custom sorting function that leverages the fact that playerID is a numeric value.
There are a couple of things that can be done to optimize the code:
forEach
and using map and flat instead. It's faster to generate an array in one pass with map than to useforEach
to push into an array.teamID
doesn't change frequently. Cache the team names in a Map where the key is theteamID
and the value is the team name.playerID
is a numeric value.Proposed revision:
TODO: Test
The text was updated successfully, but these errors were encountered: