Skip to content
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

feat(a380x/mfd): Add DATA/WAYPOINT page #9786

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Slightlyclueless
Copy link
Contributor

@Slightlyclueless Slightlyclueless commented Jan 19, 2025

Summary of Changes

Add the waypoint page under the data header

Screenshots (if necessary)

References

Additional context

Discord username (if different from GitHub):

Testing instructions

How to download the PR for QA

Every new commit to this PR will cause new A32NX and A380X artifacts to be created, built, and uploaded.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, find and click on the PR Build tab
  4. Click on either flybywire-aircraft-a320-neo, flybywire-aircraft-a380-842 (4K) or flybywire-aircraft-a380-842 (8K) download link at the bottom of the page

@Slightlyclueless Slightlyclueless changed the title feat(a380x/mfd): Add DATA/WAYPOINT page feat(a380x/mfd): Add DATA/WAYPOINT page Jan 19, 2025
Comment on lines +370 to +376
getAllStoredWaypoints(): PilotWaypoint[] {
if (this.storedWaypoints === undefined) {
return [];
} else {
return this.storedWaypoints;
}
}
Copy link
Member

@tracernz tracernz Feb 15, 2025

Choose a reason for hiding this comment

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

Suggested change
getAllStoredWaypoints(): PilotWaypoint[] {
if (this.storedWaypoints === undefined) {
return [];
} else {
return this.storedWaypoints;
}
}
getAllStoredWaypoints(): PilotWaypoint[] {
return this.storedWaypoints ?? [];
}

Could be better to just return undefined though rather than allocating an array every call when it's empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, I dislike returning undefined for elements like this. This shouldn't be called that often so I feel like the allocation is not going to be that bad (this may be C/Rust brain thinking where an allocation for that slice would be tiny)

Copy link
Member

Choose a reason for hiding this comment

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

Then why not have this.storedWaypoints always an array instead? If this is being called every time the page updates it's allocating quite a lot of unneeded objects across a flight. It's death by a thousand cuts with GC pauses = microstutter.

Copy link
Contributor Author

@Slightlyclueless Slightlyclueless Feb 21, 2025

Choose a reason for hiding this comment

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

Then why not have this.storedWaypoints always an array instead

Just checked, it already is (Line 61). So this function doesn't need any nullish coaliescing at all, it can just return the array

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