2019/07/31分のコミットです。
CHANGELOGへの追加はありませんでした。
Fix typo in autoload documentation [ci skip]
rails guideのAutoloading and Reloading Constants (Zeitwerk Mode)の修正です。
assetsをaasetsにタイポしている箇所があったのを修正しています。
Speedup and reduce Array creation when constantizing a non-namespaced string
activesupport/lib/active_support/inflector/methods.rbの修正です。
Inflector#constantizeメソッドで、引数に指定されたStringにnamespaceが含まれていない場合に不要なオブジェクトの生成を行わないよう修正しています。
No need to dup the payload for an instrumentation
actionpack/lib/action_controller/metal/instrumentation.rbの修正です。
Instrumentation#process_actionメソッドで不要なpayloadのdup処理があったのを削除しています。
Reduce String allocation when finding controller class
actionpack/lib/action_dispatch/http/request.rbの修正です。
Request#controller_class_forメソッドで定数名を生成する際にString#<<を使用してStringの生成を減らすよう修正しています。
Reduce unnecessary String creation by not to_sing until nothing matches
actionpack/lib/action_controller/renderer.rbの修正です。
Renderer#rack_key_forメソッドでfetchを使っていた箇所を[]を使用するようにして、不要な場合はデフォルト値のto_sメソッドの呼び出しを行わないよう修正しています。
Reduce object allocations in Middleware::Static
actionpack/lib/action_dispatch/middleware/static.rbの修正です
FileHandler#match?メソッドで不要なオブジェクトの生成を行わないよう修正しています。
Cache tags_text to avoid computing tags each time when logging
activesupport/lib/active_support/tagged_logging.rbの修正です。
TaggedLogging#tags_textメソッドの結果をキャッシュして、ログ出力の際に毎回処理が実行されるのを避けるよう修正しています。
Reduce Hash object creation when normalizing request env
actionpack/lib/action_controller/renderer.rbの修正です。
Renderer#initializeでHash#mergeを使っていた箇所をHash#each_pairを使うようにして、オブジェクトの生成を減らすよう修正しています。
Avoid creating new Array when looking up already registered detail
actionview/lib/action_view/lookup_context.rbの修正です。
fetchを使っていた箇所を[] + 取得出来なかった場合にデフォルト値を指定するようにして、不要な場合はデフォルト値のオブジェクトの生成を行わないよう修正しています。
Accessing ivar with Symbols might be just a very little bit better than with fstrings
ivarへのアクセスにStringを使用していたのをSymbolを使うよう修正しています。Symbolの方がちょっとはやいため、との事です。
Fix typo submited → submitted [ci skip]
actionview/test/ujs/public/test/data-remote.jsの修正です。
submittedをsubmitedにタイポしていたのを修正しています。
Polymorphic has_one touch: Reset association cache result after create transaction
activerecord/lib/active_record/associations/association.rb、
activerecord/lib/active_record/associations/builder/has_one.rbの修正です。
has_one + touchオプションを使用している場合に、commit transactionの後に場合にassociation キャッシュをクリアー(値がnilの場合のみ)するよう修正しています。
transaction内でまだ参照出来ないassociationを参照 + キャッシュしてしまい、正しいassociationを取得出来ない、というバグがあった為。
activerecord/test/cases/arel/select_manager_test.rbの修正です。
テスト名のタイポを修正しています。
Reduce some more Hash#fetch + default object allocations
actionpack/lib/action_dispatch/middleware/ssl.rb、
actionpack/lib/action_dispatch/routing/mapper.rbの修正です。
fetchを使っていた箇所を[]を使用するようにして、不要な場合はデフォルト値のオブジェクトの生成を行わないよう修正しています。
activesupport/lib/active_support/inflector/methods.rbの修正です。
Array#reverse -> Array#reverse!にしてArrayの生成を減らすよう修正しています。
Reduce Array assignment by not giving a name for unused *args
Action Packの修正です。
メソッドの引数の指定に可変長引数を使用していたが、実際は引数を使用していない箇所の引数の指定を削除しています。
actionpack/lib/action_controller/log_subscriber.rbの修正です。
Instrumentation#process_actionメソッド内のexception取得処理から不要なメソッド呼び出しを削除しています。
actionpack/lib/action_controller/metal/instrumentation.rbの修正です。
Instrumentation#process_actionメソッド内のstatus設定処理から不要なblockの実行を削除しています。
actionpack/lib/action_dispatch/http/cache.rb、
activerecord/lib/active_record/query_cache.rbの修正です。
String#tr -> String#tr!を使うよう修正、Array#<< + Array#flattenしていたのをArray#concatを使うようにしてオブジェクトの生成を減らすよう修正しています。
Reduce method invocations and object allocations in head()
actionpack/lib/action_controller/metal/head.rbの修正です。
Head#headメソッド内のoptions引数の指定処理でメソッド呼び出しとオブジェクトの生成数を減らすよう修正しています。
rubocopの設定に違反している箇所があったのをまとめて修正しています。