resolv: use safe navigation operator

* lib/resolv.rb (each_address): use safe navigation operator to
  avoid extra hash lookups, as well as each_name since r56890.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-18 02:44:50 +00:00
Родитель fcb112a172
Коммит fa5870b9c4
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -236,9 +236,7 @@ class Resolv
def each_address(name, &proc)
lazy_initialize
if @name2addr.include?(name)
@name2addr[name].each(&proc)
end
@name2addr[name]&.each(&proc)
end
##