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

Improve the Performance/TimesMap cop #422

Open
ydakuka opened this issue Dec 10, 2023 · 1 comment
Open

Improve the Performance/TimesMap cop #422

ydakuka opened this issue Dec 10, 2023 · 1 comment

Comments

@ydakuka
Copy link
Contributor

ydakuka commented Dec 10, 2023

Describe the solution you'd like

# bad
(0..8).map { |i| i }
0.upto(8).map { |i| i }

# good
Array.new(9) { |i| i }
@ydakuka
Copy link
Contributor Author

ydakuka commented Dec 10, 2023

fastruby/fast-ruby#227

koic added a commit to koic/rubocop-performance that referenced this issue Dec 12, 2023
Fixes rubocop#422.

This PR fixes false positives for `Performance/TimesMap`
with a block with safe navigation call for nil literal.
koic added a commit to koic/rubocop-performance that referenced this issue Dec 12, 2023
Fixes rubocop#422.

This PR fixes false positives for `Performance/TimesMap`
with a block with safe navigation call for nil literal.

It does not have a changelog entry because it is a patch to
a feature that has not been released yet.
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

No branches or pull requests

1 participant