From 9311afcbe882497921bd7e20add6864f1a3f43ee Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 21 Apr 2016 21:59:23 +0200 Subject: just say nothing about why this regexp is slower [ci skip] Further investigation seems to disprove that backtracking is the reason why the positive variant is slower, see https://github.com/rails/rails/pull/24658#issuecomment-213079710 so, just say nothing about it, only assert it is slower. --- activesupport/lib/active_support/core_ext/object/blank.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb index d6bad98376..b08321aeeb 100644 --- a/activesupport/lib/active_support/core_ext/object/blank.rb +++ b/activesupport/lib/active_support/core_ext/object/blank.rb @@ -115,7 +115,7 @@ class String # fallback. Penalty for the rest of strings is marginal. # # Double negation in the second operand is also a performance tweak, it is - # faster than the positive \A[[:space:]]*\z due to lack of backtracking. + # faster than the positive \A[[:space:]]*\z. empty? || !(/[[:^space:]]/ === self) end end -- cgit v1.2.3