зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Prefer String#split with block in Gem::YAMLSerializer#load
String#split supports a block since Ruby 2.6, avoiding intermediate array. https://github.com/rubygems/rubygems/commit/69cdf9e9d4
This commit is contained in:
Родитель
5f789350dc
Коммит
57178a9720
|
@ -55,7 +55,7 @@ module Gem
|
|||
stack = [res]
|
||||
last_hash = nil
|
||||
last_empty_key = nil
|
||||
str.split(/\r?\n/).each do |line|
|
||||
str.split(/\r?\n/) do |line|
|
||||
if match = HASH_REGEX.match(line)
|
||||
indent, key, quote, val = match.captures
|
||||
convert_to_backward_compatible_key!(key)
|
||||
|
|
Загрузка…
Ссылка в новой задаче