Skip to content

Completely remove Push type #52133

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 4 commits into from
Mar 1, 2023
Merged

Conversation

jakebailey
Copy link
Member

In #52122 I said I didn't have any immediate plan to attempt to remove it, but, it turns out that nearly all cases we use Push, we only ever pass in an array. The only exception to that rule is noopPush, where its only use can instead just be array?.push(...) (and I sort of expect that to be more efficient than actually going to the effort of calling a noop function through an object).

Whether or not this is desirable is another question; I can understand wanting to constrain uses to a specific operation, but I also like the cleanliness and consistency of just using arrays everywhere.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I like it, since it's clever and pedantic to specify the exact allowed interface, but unlikely to catch a bug. This is a case where I think the simplification is a win.

Edit: Probably another person should sign off too, just in case.

@sandersn
Copy link
Member

@jakebailey I'm going through all the ready-to-merge PRs, and this one has been sitting for a while. I'd say let's merge it.

@jakebailey jakebailey merged commit 6b75ce2 into microsoft:main Mar 1, 2023
@jakebailey jakebailey deleted the remove-push-2 branch March 1, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants