Drop one more string allocation

This commit is contained in:
Rafael Mendonça França 2013-11-09 18:24:49 -02:00
parent 951348aec5
commit 87d0bde03f
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ module ActionView
EMPTY = ''
def from_rails_root(string)
string.sub(rails_root, EMPTY).sub(VIEWS_PATTERN, EMPTY)
string = string.sub(rails_root, EMPTY)
string.sub!(VIEWS_PATTERN, EMPTY)
string
end
def rails_root