diff options
| author | Samuel Giddins <segiddins@segiddins.me> | 2023-12-13 03:46:10 -0800 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-12-13 22:00:26 +0000 |
| commit | baf2ec2ca8127cd610a3681a1e84ebcb404fe8f2 (patch) | |
| tree | 34f648186b45ea9a4927717d78528586d8848c80 /test | |
| parent | b266890dab38d12ad52288d5edf60f885ae5b8ce (diff) | |
[rubygems/rubygems] Use match? when regexp match data is unused
Improved performance / reduced allocations
https://github.com/rubygems/rubygems/commit/b04726c9a7
Diffstat (limited to 'test')
| -rw-r--r-- | test/rubygems/helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 1cdf7c4459..d259fbde1b 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -582,7 +582,7 @@ class Gem::TestCase < Test::Unit::TestCase end def in_path?(executable) # :nodoc: - return true if %r{\A([A-Z]:|/)} =~ executable && File.exist?(executable) + return true if %r{\A([A-Z]:|/)}.match?(executable) && File.exist?(executable) ENV["PATH"].split(File::PATH_SEPARATOR).any? do |directory| File.exist? File.join directory, executable |
