提交 8fb838ed 编写于 作者: A Aaron Patterson

use Hash#each to avoid a second hash lookup

上级 6b29dc87
......@@ -283,10 +283,8 @@ def empty_insert_statement_value
def select(sql, name = nil) #:nodoc:
execute(sql, name).map do |row|
record = {}
row.each_key do |key|
if key.is_a?(String)
record[key.sub(/^"?\w+"?\./, '')] = row[key]
end
row.each do |key, value|
record[key.sub(/^"?\w+"?\./, '')] = value if key.is_a?(String)
end
record
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册