提交 cf00da66 编写于 作者: A Aaron Patterson

PERF: reduce calls to Hash#[]

上级 c7b4f12d
......@@ -8,11 +8,11 @@ def initialize
def name_for(relation)
table = relation.table
name = table.table_alias || table.name
@names[name] ||= []
list = @names[name] ||= []
@names[name] << table unless @names[name].include? table
list << table unless list.include? table
idx = @names[name].index table
idx = list.index table
name + (idx == 0 ? '' : "_#{idx + 1}")
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册