Skip to content
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

unify the code for filter methods (and speed up #reject!) #6236

Merged
merged 1 commit into from Apr 14, 2024

Conversation

leviongit
Copy link
Contributor

the worst case for Array#reject! (i.e. a proc always returning true) is at least 5x worse than the worst case for Array#select! (proc always returning false)

this commit unifies these implementations and inlines the (effective) call of #select! in #keep_if and #reject! in #delete_if

the worst case for `Array#reject!` (i.e. a proc always returning `true`)
is at least 5x worse than the worst case for `Array#select!` (proc
always returning `false`)

this commit unifies these implementations and inlines the (effective)
call of `#select!` in `#keep_if` and `#reject!` in `#delete_if`
@leviongit leviongit requested a review from matz as a code owner April 13, 2024 06:57
@matz matz merged commit c183e12 into mruby:master Apr 14, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants