aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-21 11:01:19 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-21 11:01:19 -0700
commitf3ebbeae6eb647767ccd49e25821b1ba33923596 (patch)
tree0fba1c6dbffa9700aed8c28b10cffe6061c18ecd /activerecord/lib/active_record
parent50823452f70341447a010df27dd514fd97bfe8a9 (diff)
downloadrails-f3ebbeae6eb647767ccd49e25821b1ba33923596.tar.gz
rails-f3ebbeae6eb647767ccd49e25821b1ba33923596.tar.bz2
rails-f3ebbeae6eb647767ccd49e25821b1ba33923596.zip
avoid creating a set if no where values are removed
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/merger.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/merger.rb b/activerecord/lib/active_record/relation/merger.rb
index a65ef1898a..c114ea0c0d 100644
--- a/activerecord/lib/active_record/relation/merger.rb
+++ b/activerecord/lib/active_record/relation/merger.rb
@@ -131,6 +131,8 @@ module ActiveRecord
end
def filter_binds(lhs_binds, removed_wheres)
+ return lhs_binds if removed_wheres.empty?
+
set = Set.new removed_wheres.map { |x| x.left.name }
lhs_binds.dup.delete_if { |col,_| set.include? col.name }
end