Permalink
Browse files

Expand double-negative in String#blank? regex

  • Loading branch information...
1 parent 64b9e93 commit 30ba7ee5961bc2c424f28e0319b65f37381d623f @tmm1 tmm1 committed Nov 20, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

1 comment on commit 30ba7ee

Member

schneems commented on 30ba7ee Apr 28, 2016

Do you remember why you made this change? We're trying to figure out why one is slower than the other in some benchmarks but not in others #24658 (comment)

Please sign in to comment.