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

Fixes rubocop violation Performance/StringReplacement #1039

Conversation

pmatsinopoulos
Copy link

Summary

Fixes rubocop violation Performance/StringReplacement

Details

Changes to stop using .gsub() to do character replacements, but use ,tr() instead. Also, when
.gsub() was used to delete a character, we are now using .delete().

Motivation and Context

This change makes sure our code is compliant with the ruboxop Performance/StringReplacemenet rule

Refs #1021

How Has This Been Tested?

I have run all the tests with bundle exec rake and everything is green. Rubocop is happy too.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvements

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@nodo
Copy link
Member

nodo commented Oct 27, 2016

Hi @pmatsinopoulos , thanks again for your effort. Please, could you rebase the PR?

@pmatsinopoulos pmatsinopoulos force-pushed the fix-style-violation-1021-performance-string-replacement branch from d9976eb to 585ad21 Compare October 28, 2016 04:28
@pmatsinopoulos
Copy link
Author

@nodo I just did the rebase.

@nodo nodo merged commit 15d698c into cucumber:master Nov 8, 2016
@nodo
Copy link
Member

nodo commented Nov 8, 2016

Thanks @pmatsinopoulos ! 👍

@pmatsinopoulos pmatsinopoulos deleted the fix-style-violation-1021-performance-string-replacement branch November 9, 2016 06:21
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants