aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-11-20 16:47:41 -0800
committerXavier Noria <fxn@hashref.com>2013-11-20 16:47:41 -0800
commit9b423c98118c8900ee0bc4bfcf1f8eb1ad0632d5 (patch)
tree7db648a0bbe7a52c41b22df16a2c624fb4a554b8 /activesupport
parent64b9e93bb571160315987862583a83222e506734 (diff)
parent30ba7ee5961bc2c424f28e0319b65f37381d623f (diff)
downloadrails-9b423c98118c8900ee0bc4bfcf1f8eb1ad0632d5.tar.gz
rails-9b423c98118c8900ee0bc4bfcf1f8eb1ad0632d5.tar.bz2
rails-9b423c98118c8900ee0bc4bfcf1f8eb1ad0632d5.zip
Merge pull request #12976 from tmm1/faster-blank
Faster String#blank?
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/object/blank.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb
index 8a5eb4bc93..f9ff4d9567 100644
--- a/activesupport/lib/active_support/core_ext/object/blank.rb
+++ b/activesupport/lib/active_support/core_ext/object/blank.rb
@@ -90,7 +90,7 @@ class String
# ' '.blank? # => true
# ' something here '.blank? # => false
def blank?
- self !~ /[^[:space:]]/
+ self =~ /\A[[:space:]]*\z/
end
end