Allocate one less object using html_safe during content_tag construction #12853

Merged
merged 1 commit into from Nov 15, 2013

Conversation

Projects
None yet
4 participants
Contributor

joshjordan commented Nov 11, 2013

This call to html_safe is unnecessary because content_tag_string already calls html_safe on tag_options. All ActionView tests are still passing.

Contributor

joshjordan commented Nov 14, 2013

Pretty simple PR. Any feedback here?

Owner

guilleiguaran commented Nov 14, 2013

I guess everyone is scared of get rid of a .html_safe in the code 😨

Contributor

dmathieu commented Nov 14, 2013

This fear would be easily solved with a test checking that the returned string is a SafeBuffer.

Contributor

joshjordan commented Nov 15, 2013

@dmathieu this is already tested in tag_helper_test.rb on line 39.

@rafaelfranca rafaelfranca added a commit that referenced this pull request Nov 15, 2013

@rafaelfranca rafaelfranca Merge pull request #12853 from joshjordan/master
Allocate one less object using html_safe during content_tag construction
f6f4bed

@rafaelfranca rafaelfranca merged commit f6f4bed into rails:master Nov 15, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment