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 /lib/bundler/templates | |
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 'lib/bundler/templates')
-rw-r--r-- | lib/bundler/templates/Executable.bundler | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/templates/Executable.bundler b/lib/bundler/templates/Executable.bundler index e290fe91eb..caa2021701 100644 --- a/lib/bundler/templates/Executable.bundler +++ b/lib/bundler/templates/Executable.bundler @@ -27,7 +27,7 @@ m = Module.new do bundler_version = nil update_index = nil ARGV.each_with_index do |a, i| - if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) bundler_version = a end next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ |