summaryrefslogtreecommitdiff
path: root/lib/rubygems/util.rb
diff options
context:
space:
mode:
authorSamuel Giddins <[email protected]>2023-12-13 03:46:10 -0800
committergit <[email protected]>2023-12-13 22:00:26 +0000
commitbaf2ec2ca8127cd610a3681a1e84ebcb404fe8f2 ()
tree34f648186b45ea9a4927717d78528586d8848c80 /lib/rubygems/util.rb
parentb266890dab38d12ad52288d5edf60f885ae5b8ce (diff)
[rubygems/rubygems] Use match? when regexp match data is unused
Improved performance / reduced allocations https://.com/rubygems/rubygems/commit/b04726c9a7
-rw-r--r--lib/rubygems/util.rb2
1 files changed, 1 insertions, 1 deletions
@@ -109,7 +109,7 @@ module Gem::Util
# comes with a leading slash.
def self.correct_for_windows_path(path)
- if path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":"
path[1..-1]
else
path