Permalink
Browse files

Avoid regexp unless reviewer is enabled

  • Loading branch information...
1 parent da0a6fc commit cf58d76fe8271d942a940a47ce3c71bf1074c8dc @tmm1 tmm1 committed Nov 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/query_reviewer/mysql_adapter_extensions.rb
@@ -46,7 +46,7 @@ def select_with_review(sql, *args)
query_results = select_without_review(sql, *args)
t2 = Time.now
- if @logger && sql =~ /^select/i && query_reviewer_enabled?
+ if @logger && query_reviewer_enabled? && sql =~ /^select/i
use_profiling = QueryReviewer::CONFIGURATION["profiling"]
use_profiling &&= (t2 - t1) >= QueryReviewer::CONFIGURATION["warn_duration_threshold"].to_f / 2.0 if QueryReviewer::CONFIGURATION["production_data"]

0 comments on commit cf58d76

Please sign in to comment.