Skip to content

convertToAsyncFunction: Use ReadonlyArray / ReadonlyMap where possible #27190

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
2 commits merged into from
Sep 20, 2018

Conversation

ghost
Copy link

@ghost ghost commented Sep 18, 2018

Noticed while reviewing #27188 that we never actually need a NodeArray, we can just use ReadonlyArrays everywhere.
All remaining X[] arrays cause a compile error if changed to ReadonlyArray.
Also using emptyArray instead of [] where possible to reduce allocations.

@ghost ghost requested a review from uniqueiniquity September 18, 2018 17:19
@ghost ghost force-pushed the convertToAsyncFunction_readonlyarray branch from bc4f4c6 to c688f99 Compare September 18, 2018 17:19
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Sep 18, 2018
@RyanCavanaugh
Copy link
Member

Approved but please wait to merge until the last master train goes in (late today)

@ghost ghost merged commit 5f563c9 into master Sep 20, 2018
@ghost ghost deleted the convertToAsyncFunction_readonlyarray branch September 20, 2018 23:45
@uniqueiniquity uniqueiniquity mentioned this pull request Oct 9, 2018
This pull request was closed.
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