Generate less garbage when expanding range bind variables in conditions

This commit is contained in:
Jeremy Kemper 2008-06-06 03:54:16 -07:00
parent 566d717d78
commit fd40fbc198

@ -2064,13 +2064,18 @@ def replace_named_bind_variables(statement, bind_vars) #:nodoc:
end
def expand_range_bind_variables(bind_vars) #:nodoc:
bind_vars.sum do |var|
expanded = []
bind_vars.each do |var|
if var.is_a?(Range)
[var.first, var.last]
expanded << var.first
expanded << var.last
else
[var]
expanded << var
end
end
expanded
end
def quote_bound_value(value) #:nodoc: