diff options
author | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2013-11-27 15:51:47 +0530 |
---|---|---|
committer | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2013-11-27 15:51:47 +0530 |
commit | fff0309081219ec032ed08f0a4c3e61cacfafa37 (patch) | |
tree | 895608d6f7ff55e3a3cd77b6749709132f5ae685 /actionview | |
parent | 260471a5e1b00136fc2d6e66bab29059fc6d8174 (diff) | |
download | rails-fff0309081219ec032ed08f0a4c3e61cacfafa37.tar.gz rails-fff0309081219ec032ed08f0a4c3e61cacfafa37.tar.bz2 rails-fff0309081219ec032ed08f0a4c3e61cacfafa37.zip |
unnecessary checking of `size` with `second regex` if matched with first one
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/asset_tag_helper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb index 2a44ae5d5c..b1ba9da4cf 100644 --- a/actionview/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb @@ -208,8 +208,11 @@ module ActionView end if size = options.delete(:size) - options[:width], options[:height] = size.split("x") if size =~ %r{\A\d+x\d+\z} - options[:width] = options[:height] = size if size =~ %r{\A\d+\z} + if size =~ %r{\A\d+x\d+\z} + options[:width], options[:height] = size.split('x') + elsif size =~ %r{\A\d+\z} + options[:width] = options[:height] = size + end end tag("img", options) |