[rubygems/rubygems] Use value.match? only on Strings, which avoids allocating a matchdata, which is not used

https://github.com/rubygems/rubygems/commit/cbf9ac93d7
This commit is contained in:
Josh Nichols 2023-08-16 15:08:38 -04:00 committed by git
parent 598048e3dd
commit 239e35254b

View File

@ -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