Skip to content
Browse files

Don't create fibers just to iterate

  • Loading branch information...
1 parent ccb0301 commit 6ebc07bc5b5cecbefaa0559e5c8a76b712be00e3 @njakobsen njakobsen committed with tenderlove Aug 30, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/relation/merger.rb
View
6 activerecord/lib/active_record/relation/merger.rb
@@ -117,11 +117,11 @@ def merge_multi_values
bind_values = filter_binds(lhs_binds, removed) + rhs_binds
conn = relation.klass.connection
- bviter = bind_values.each.with_index
+ bv_index = 0
where_values.map! do |node|
if Arel::Nodes::Equality === node && Arel::Nodes::BindParam === node.right
- (column, _), i = bviter.next
- substitute = conn.substitute_at column, i
+ substitute = conn.substitute_at(bind_values[bv_index].first, bv_index)
+ bv_index += 1
Arel::Nodes::Equality.new(node.left, substitute)
else
node

0 comments on commit 6ebc07b

Please sign in to comment.
Something went wrong with that request. Please try again.