[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:
parent
598048e3dd
commit
239e35254b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user