Skip to content

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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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