Skip to content

Commit

Permalink
Merge pull request #12976 from tmm1/faster-blank
Browse files Browse the repository at this point in the history
Faster String#blank?
  • Loading branch information
fxn committed Nov 21, 2013
2 parents 64b9e93 + 30ba7ee commit 9b423c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/object/blank.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class String
# ' '.blank? # => true # ' '.blank? # => true
# ' something here '.blank? # => false # ' something here '.blank? # => false
def blank? def blank?
self !~ /[^[:space:]]/ self =~ /\A[[:space:]]*\z/
end end
end end


Expand Down

0 comments on commit 9b423c9

Please sign in to comment.