[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:
Mau Magnaguagno 2023-11-26 04:07:14 -03:00 committed by git
parent 52c7e43b87
commit 67ee91a305

View File

@ -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