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

Don't use concat when not necessary #660

Merged
merged 2 commits into from
Oct 2, 2022

Conversation

lcreid
Copy link
Contributor

@lcreid lcreid commented Oct 1, 2022

ActionView::Helpers::TextHelper#concat is not recommended for use, and was leading to some confusing results while I was trying to refactor for #642 .

This PR removes concat from the code, except where it was needed in some test cases. (And perhaps there's a way to get rid of it from the test cases, too, but I didn't investigated it.) In the test cases, we now use ActionView::Helpers::TextHelper#concat consistently.

This PR also replaces String#+= with String#<< since the internet says the String#<< is much faster.

@lcreid lcreid requested review from donv and thimo October 1, 2022 20:09
@lcreid lcreid self-assigned this Oct 1, 2022
@lcreid lcreid merged commit fe66580 into bootstrap-ruby:main Oct 2, 2022
@lcreid lcreid deleted the get-rid-of-concat branch November 24, 2022 02:29
@donv donv mentioned this pull request May 19, 2023
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.

2 participants