mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Change from map
=> map!
and collect!
to save creation of extra array.
This commit is contained in:
parent
e14039eacb
commit
4ce11c0150
1 changed files with 2 additions and 2 deletions
|
@ -215,7 +215,7 @@ module ActionView
|
|||
def word_wrap(text, options = {})
|
||||
line_width = options.fetch(:line_width, 80)
|
||||
|
||||
text.split("\n").collect do |line|
|
||||
text.split("\n").collect! do |line|
|
||||
line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line
|
||||
end * "\n"
|
||||
end
|
||||
|
@ -264,7 +264,7 @@ module ActionView
|
|||
if paragraphs.empty?
|
||||
content_tag(wrapper_tag, nil, html_options)
|
||||
else
|
||||
paragraphs.map { |paragraph|
|
||||
paragraphs.map! { |paragraph|
|
||||
content_tag(wrapper_tag, paragraph, html_options, options[:sanitize])
|
||||
}.join("\n\n").html_safe
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue