Skip to content

Commit

Permalink
Merge pull request #13072 from kuldeepaggarwal/unwanted-code
Browse files Browse the repository at this point in the history
unnecessary checking of `size` with `second regex` if matched with former regex
  • Loading branch information
fxn committed Nov 27, 2013
2 parents fbe5baa + fff0309 commit f15bd23
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
Original file line number Original file line Diff line number Diff line change
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 f15bd23

Please sign in to comment.