-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Performance/Detect does not work with [0] or [-1] #163
Comments
iSarCasm
changed the title
Performance/Detect does no work with [0] or [-1]
Performance/Detect does not work with [0] or [-1]
Sep 3, 2020
dvandersluis
added a commit
to dvandersluis/rubocop-performance
that referenced
this issue
Sep 10, 2020
For example, `[1, 2, 3].detect{ ... }[0]` will now be caught and corrected by the cop.
8 tasks
dvandersluis
added a commit
to dvandersluis/rubocop-performance
that referenced
this issue
Sep 11, 2020
For example, `[1, 2, 3].detect{ ... }[0]` will now be caught and corrected by the cop.
dvandersluis
added a commit
to dvandersluis/rubocop-performance
that referenced
this issue
Sep 11, 2020
For example, `[1, 2, 3].detect{ ... }[0]` will now be caught and corrected by the cop.
dvandersluis
added a commit
to dvandersluis/rubocop-performance
that referenced
this issue
Sep 11, 2020
For example, `[1, 2, 3].detect{ ... }[0]` will now be caught and corrected by the cop.
dvandersluis
added a commit
to dvandersluis/rubocop-performance
that referenced
this issue
Sep 14, 2020
For example, `[1, 2, 3].detect{ ... }[0]` will now be caught and corrected by the cop.
koic
added a commit
that referenced
this issue
Sep 16, 2020
[Fix #163] Detect array indexes for `Performance/Detect`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Since for arrays
[0]
is usually the same as.first
and[-1]
is same as.last
I would expect thePerformance/Detect
to identify performance problems with index syntax as well.Describe the solution you'd like
Add index syntax to
Performance/Detect
copThe text was updated successfully, but these errors were encountered: