summaryrefslogtreecommitdiff
path: root/lib/rubygems/config_file.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-04-04 12:03:13 +0900
committergit <svn-admin@ruby-lang.org>2023-04-04 12:20:43 +0000
commita881b33818b101ad097cd0158afda11b6c24f1fc (patch)
tree73111721667233a91e214e4df703d91ab19cfded /lib/rubygems/config_file.rb
parenta78e0ca968115cbf57228cf2c026d2e21534dc7b (diff)
[rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
Diffstat (limited to 'lib/rubygems/config_file.rb')
-rw-r--r--lib/rubygems/config_file.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index 9017415308..0a5f6ffad2 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -483,7 +483,7 @@ if you believe they were disclosed to a third party.
@hash.each do |key, value|
key = key.to_s
- next if key =~ re
+ next if key&.match?(re)
yaml_hash[key.to_s] = value
end
@@ -534,7 +534,7 @@ if you believe they were disclosed to a third party.
need_config_file_name = false
elsif arg =~ /^--config-file=(.*)/
@config_file_name = $1
- elsif arg =~ /^--config-file$/
+ elsif /^--config-file$/.match?(arg)
need_config_file_name = true
end
end