Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

`execute` is a hotspot, so let's reduce branches

  • Loading branch information...
commit 4bf7071d630114fced0e474a93ba9fc16bae10e7 1 parent 4dc4204
@tenderlove tenderlove authored
View
8 activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -298,11 +298,7 @@ def disable_referential_integrity #:nodoc:
# Executes the SQL statement in the context of this connection.
def execute(sql, name = nil)
- if name == :skip_logging
- @connection.query(sql)
- else
- log(sql, name) { @connection.query(sql) }
- end
+ log(sql, name) { @connection.query(sql) }
end
# MysqlAdapter has to free a result after using it, so we use this method to write
@@ -775,7 +771,7 @@ def configure_connection
end.compact.join(', ')
# ...and send them all in one query
- execute("SET #{encoding} #{variable_assignments}", :skip_logging)
+ @connection.query "SET #{encoding} #{variable_assignments}"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.