diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2014-11-01 18:48:23 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2014-11-01 18:48:23 -0600 |
commit | 8b611b705b668d98ad2b7cf166f7e99cffca6ba3 (patch) | |
tree | ed05724bb101dfebb48d138ee58f77777641173c /activerecord | |
parent | 50e7c013c04544091f0081e495cacdd987f4d8e1 (diff) | |
parent | 861b70e92f4a1fc0e465ffcf2ee62680519c8f6f (diff) | |
download | rails-8b611b705b668d98ad2b7cf166f7e99cffca6ba3.tar.gz rails-8b611b705b668d98ad2b7cf166f7e99cffca6ba3.tar.bz2 rails-8b611b705b668d98ad2b7cf166f7e99cffca6ba3.zip |
Merge pull request #17483 from pabloh/optimize_gsub_calls
Call gsub with a Regexp instead of a String for better performance
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index ff70cbed0f..2c5cf944a4 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -134,7 +134,7 @@ module ActiveRecord raise_if_bind_arity_mismatch(statement, statement.count('?'), values.size) bound = values.dup c = connection - statement.gsub('?') do + statement.gsub(/\?/) do replace_bind_variable(bound.shift, c) end end |