Skip to content

Feature/dev 50419 #2142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 12, 2025
Merged

Feature/dev 50419 #2142

merged 5 commits into from
Jun 12, 2025

Conversation

adamdoe
Copy link
Collaborator

@adamdoe adamdoe commented May 27, 2025

PR Description

Summary

This PR optimizes the formatLegendLocation helper function in formatLegendLocation.ts by improving how county key lookups are performed.

Details

  • Performance Improvement:
    Previously, the function recreated an array of county keys and used .includes() on every call. This has been replaced with a Set (countyKeySet) that is created once at module load, allowing for faster .has() lookups.
  • No Functional Change:
    The logic and output of formatLegendLocation remain the same. Only the internal implementation has changed for efficiency and code clarity.

Benefits

  • Reduces unnecessary computation on each function call.
  • Improves readability and maintainability of the code.

Testing Steps

Add/Remove the diff to see the performance improvement on county maps here:

No other files or logic were affected.

@adamdoe adamdoe requested a review from Atash3000 June 3, 2025 17:05
@adamdoe adamdoe added this to the 4.25.6 milestone Jun 3, 2025
@adamdoe adamdoe marked this pull request as ready for review June 3, 2025 17:06
@adamdoe adamdoe merged commit 91aff95 into dev Jun 12, 2025
3 of 6 checks passed
@adamdoe adamdoe deleted the feature/DEV-50419 branch June 12, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant