зеркало из https://github.com/github/ruby.git
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:
Родитель
fcb112a172
Коммит
fa5870b9c4
|
@ -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
|
||||
|
||||
##
|
||||
|
|
Загрузка…
Ссылка в новой задаче