Skip to content

Conversation

@tariknz
Copy link
Owner

@tariknz tariknz commented Jul 20, 2025

No description provided.

@tariknz tariknz marked this pull request as ready for review July 21, 2025 01:58
Copilot AI review requested due to automatic review settings July 21, 2025 01:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes performance issues in the driver relatives calculation by replacing inefficient array manipulation patterns with a more optimized approach. The changes eliminate redundant filtering and mapping operations while improving the sorting logic for relative positions.

  • Refactored the driver filtering and mapping logic to reduce computational overhead
  • Implemented separate sorting for drivers ahead and behind the player position
  • Added proper filtering to handle NaN values for both relativePct and delta calculations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/frontend/components/Standings/hooks/useDriverRelatives.tsx Optimized driver filtering and sorting logic to improve performance and fix relative position calculations
src/frontend/components/Standings/hooks/useDriverPositions.tsx Minor formatting fixes for trailing commas in function calls

@tariknz tariknz merged commit aa88356 into main Jul 21, 2025
1 check passed
@tariknz tariknz deleted the chore/relative-perf branch July 21, 2025 02:03
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.

2 participants