Skip to content

Commit

Permalink
Avoid regexp unless reviewer is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Nov 15, 2012
1 parent da0a6fc commit cf58d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/query_reviewer/mysql_adapter_extensions.rb
Expand Up @@ -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"]

Expand Down

0 comments on commit cf58d76

Please sign in to comment.