ruby-changes:46005
From: normal <ko1@a...>
Date: Fri, 24 Mar 2017 16:29:40 +0900 (JST)
Subject: [ruby-changes:46005] normal:r58076 (trunk): logger: remove redundant opt_str_freeze use
normal 2017-03-24 16:29:33 +0900 (Fri, 24 Mar 2017) New Revision: 58076 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58076 Log: logger: remove redundant opt_str_freeze use Strings in "when" statements are allocation-free, so there's never any reason to uglify the code to use opt_str_freeze over the normal putobject instructions, here. Modified files: trunk/lib/logger.rb Index: lib/logger.rb =================================================================== --- lib/logger.rb (revision 58075) +++ lib/logger.rb (revision 58076) @@ -268,17 +268,17 @@ class Logger https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L268 @level = severity else case severity.to_s.downcase - when 'debug'.freeze + when 'debug' @level = DEBUG - when 'info'.freeze + when 'info' @level = INFO - when 'warn'.freeze + when 'warn' @level = WARN - when 'error'.freeze + when 'error' @level = ERROR - when 'fatal'.freeze + when 'fatal' @level = FATAL - when 'unknown'.freeze + when 'unknown' @level = UNKNOWN else raise ArgumentError, "invalid log level: #{severity}" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/