Skip to content

Conversation

@jakebailey
Copy link
Member

For #2454

Copilot AI review requested due to automatic review settings January 8, 2026 23:13
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 optimizes the getLiteralTypeFromProperties function by preallocating the types slice with an appropriate capacity to avoid dynamic growth during append operations.

Key changes:

  • Stores props and indexInfos in variables before the loops to calculate capacity
  • Preallocates the types slice with capacity len(props) + len(indexInfos)
  • Maintains identical behavior while improving performance by reducing allocations

@ahejlsberg ahejlsberg added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit 2a31979 Jan 9, 2026
28 checks passed
@ahejlsberg ahejlsberg deleted the jabaile/part-of-2454 branch January 9, 2026 19:00
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.

3 participants