mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/logger] Prefer String#[0, 1] over [0..0]
[0..0] internally creates an extra Array object, and so is slower and much more memory consuming https://github.com/ruby/logger/commit/20616ad34a
This commit is contained in:
parent
4f25971f05
commit
0b62535219
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ class Logger
|
|||
end
|
||||
|
||||
def call(severity, time, progname, msg)
|
||||
Format % [severity[0..0], format_datetime(time), Process.pid, severity, progname,
|
||||
Format % [severity[0, 1], format_datetime(time), Process.pid, severity, progname,
|
||||
msg2str(msg)]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue