Skip to content

Commit

Permalink
unnecessary checking of size with second regex if matched with fi…
Browse files Browse the repository at this point in the history
…rst one
  • Loading branch information
kuldeepaggarwal committed Nov 27, 2013
1 parent 260471a commit fff0309
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions actionview/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -208,8 +208,11 @@ def image_tag(source, options={})
end end


if size = options.delete(:size) if size = options.delete(:size)
options[:width], options[:height] = size.split("x") if size =~ %r{\A\d+x\d+\z} if size =~ %r{\A\d+x\d+\z}
options[:width] = options[:height] = size if size =~ %r{\A\d+\z} options[:width], options[:height] = size.split('x')
elsif size =~ %r{\A\d+\z}
options[:width] = options[:height] = size
end
end end


tag("img", options) tag("img", options)
Expand Down

0 comments on commit fff0309

Please sign in to comment.