Skip to content

Don't allocate empty slice for named members #1312

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 1 commit into from
Jul 7, 2025

Conversation

jakebailey
Copy link
Member

This shaves off a few allocs in vscode.

@Copilot Copilot AI review requested due to automatic review settings June 28, 2025 22:48
Copy link
Contributor

@Copilot 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 optimizes the memory allocation in the checker by returning nil instead of allocating an empty slice for named members.

  • Return nil when the members map is empty.
  • Reduce unnecessary memory allocation in getNamedMembers function.
Comments suppressed due to low confidence (1)

@jakebailey jakebailey added this pull request to the merge queue Jul 7, 2025
Merged via the queue into main with commit b7f1b49 Jul 7, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/alloc-opt-named-members branch July 7, 2025 21:32
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