Skip to content

[Fix #396]#507

Open
pessi-v wants to merge 2 commits into
rubocop:masterfrom
pessi-v:add-new-array-insert-cop
Open

[Fix #396]#507
pessi-v wants to merge 2 commits into
rubocop:masterfrom
pessi-v:add-new-array-insert-cop

Conversation

@pessi-v

@pessi-v pessi-v commented Jun 23, 2025

Copy link
Copy Markdown

Use unshift instead of insert(0, ...) for better performance. The unshift method is specifically optimized for prepending elements and is faster than using insert at index 0.

Idea was taken from fast-ruby.

@pessi-v

pessi-v commented Jun 23, 2025

Copy link
Copy Markdown
Author

Ok, I think this one is ready for review!

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.

1 participant