1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Improve performance of #uniq across a large number of nodes

This commit is contained in:
Sam 2013-08-30 15:44:10 +10:00
parent 4524c7f8a8
commit 707554e6a8

View file

@ -124,7 +124,10 @@ Arel 4.0.0 with no replacement. PEW PEW PEW!!!
end
def hash
[@name, @engine, @aliases, @table_alias].hash
# Perf note: aliases, table alias and engine is excluded from the hash
# aliases can have a loop back to this table breaking hashes in parent
# relations, for the vast majority of cases @name is unique to a query
@name.hash
end
def eql? other