Skip to content

Commit d53dc86

Browse files
Merge pull request rails#47714 from nirebu/nirebu/stop-root-string-allocation-in-helper
Do not allocate the first path character in asset helper
2 parents bc081a5 + a63ae91 commit d53dc86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionview/lib/action_view/helpers/asset_url_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def asset_path(source, options = {})
196196
source = "#{source}#{extname}"
197197
end
198198

199-
if source[0] != ?/
199+
unless source.start_with?(?/)
200200
if options[:skip_pipeline]
201201
source = public_compute_asset_path(source, options)
202202
else

0 commit comments

Comments
 (0)