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

Performance/StringReplacement doesn't check for case insensitivity #2294

Closed
matthewd opened this issue Oct 4, 2015 · 1 comment · Fixed by #2312
Closed

Performance/StringReplacement doesn't check for case insensitivity #2294

matthewd opened this issue Oct 4, 2015 · 1 comment · Fixed by #2312
Labels

Comments

@matthewd
Copy link

matthewd commented Oct 4, 2015

0.34.2 (using Parser 2.2.2.6, running on ruby 2.2.3 x86_64-darwin14)

Performance/StringReplacement auto-corrects:

s.gsub(/x/i, 'q')
s.gsub(/z/i, '')

to:

s.tr('x', 'q')
s.delete('z')

The new versions no longer match X and Z respectively.

@bbatsov bbatsov added the bug label Oct 7, 2015
@rrosenblum
Copy link
Contributor

Thanks for the bug report. I forgot to account for regex options. I am working on a fix for this now.

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 a pull request may close this issue.

3 participants