Skip to content

Commit

Permalink
unless Array#empty? is faster than if Array#present?
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 11, 2010
1 parent 8464ee0 commit dac2b37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -217,7 +217,7 @@ def build_joins(relation, joins)
end end


def build_select(arel, selects) def build_select(arel, selects)
if selects.present? unless selects.empty?
@implicit_readonly = false @implicit_readonly = false
# TODO: fix this ugly hack, we should refactor the callers to get an ARel compatible array. # TODO: fix this ugly hack, we should refactor the callers to get an ARel compatible array.
# Before this change we were passing to ARel the last element only, and ARel is capable of handling an array # Before this change we were passing to ARel the last element only, and ARel is capable of handling an array
Expand Down

0 comments on commit dac2b37

Please sign in to comment.