mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Save a hash allocation in MySQL statement pool
There's no need to wrap the statement in a hash with a single key.
This commit is contained in:
parent
e970d15211
commit
f2a9063373
2 changed files with 2 additions and 5 deletions
|
@ -44,7 +44,7 @@ module ActiveRecord
|
|||
|
||||
class StatementPool < ConnectionAdapters::StatementPool # :nodoc:
|
||||
private def dealloc(stmt)
|
||||
stmt[:stmt].close
|
||||
stmt.close
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -71,10 +71,7 @@ module ActiveRecord
|
|||
|
||||
log(sql, name, binds, type_casted_binds) do
|
||||
if cache_stmt
|
||||
cache = @statements[sql] ||= {
|
||||
stmt: @connection.prepare(sql)
|
||||
}
|
||||
stmt = cache[:stmt]
|
||||
stmt = @statements[sql] ||= @connection.prepare(sql)
|
||||
else
|
||||
stmt = @connection.prepare(sql)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue