[ruby/psych] Prefer each_char in Psych::Visitors::Visitor::ToRuby#deserialize
Use safe navigation operator with each_char to remove empty strings and improve readability. https://github.com/ruby/psych/commit/5fe714b216
This commit is contained in:
parent
52c7e43b87
commit
67ee91a305
@ -101,7 +101,7 @@ module Psych
|
||||
source = $1
|
||||
options = 0
|
||||
lang = nil
|
||||
($2 || '').split('').each do |option|
|
||||
$2&.each_char do |option|
|
||||
case option
|
||||
when 'x' then options |= Regexp::EXTENDED
|
||||
when 'i' then options |= Regexp::IGNORECASE
|
||||
|
Loading…
x
Reference in New Issue
Block a user