diff options
author | Josh Nichols <josh.nichols@gusto.com> | 2023-08-16 15:08:38 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-08-20 09:06:36 +0000 |
commit | 239e35254bc26e747d40fd99e348d486d9ae9f87 (patch) | |
tree | ff182e3d61626d70f88dc1cfdfc0f57a879a4b9d /lib/bundler/settings.rb | |
parent | 598048e3ddfc0dec301a4574af8d945cddee5e76 (diff) |
[rubygems/rubygems] Use value.match? only on Strings, which avoids allocating a matchdata, which is not used
https://github.com/rubygems/rubygems/commit/cbf9ac93d7
Diffstat (limited to 'lib/bundler/settings.rb')
-rw-r--r-- | lib/bundler/settings.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index e66e2d572f..0275844dc1 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -351,7 +351,13 @@ module Bundler def to_bool(value) case value - when nil, /\A(false|f|no|n|0|)\z/i, false + when String + if value.match?(/\A(false|f|no|n|0|)\z/i) + false + else + true + end + when nil, false false else true |