[ruby/fileutils] Reduce global variables

https://github.com/ruby/fileutils/commit/ba81f024cf
This commit is contained in:
Kazuhiro NISHIYAMA 2019-08-24 21:19:31 +09:00 committed by Hiroshi SHIBATA
parent 06c35cfa65
commit d5355123cc
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -1520,14 +1520,14 @@ module FileUtils
private
$fileutils_rb_have_lchmod = nil
@@fileutils_rb_have_lchmod = nil
def have_lchmod?
# This is not MT-safe, but it does not matter.
if $fileutils_rb_have_lchmod == nil
$fileutils_rb_have_lchmod = check_have_lchmod?
if @@fileutils_rb_have_lchmod == nil
@@fileutils_rb_have_lchmod = check_have_lchmod?
end
$fileutils_rb_have_lchmod
@@fileutils_rb_have_lchmod
end
def check_have_lchmod?
@ -1538,14 +1538,14 @@ module FileUtils
return false
end
$fileutils_rb_have_lchown = nil
@@fileutils_rb_have_lchown = nil
def have_lchown?
# This is not MT-safe, but it does not matter.
if $fileutils_rb_have_lchown == nil
$fileutils_rb_have_lchown = check_have_lchown?
if @@fileutils_rb_have_lchown == nil
@@fileutils_rb_have_lchown = check_have_lchown?
end
$fileutils_rb_have_lchown
@@fileutils_rb_have_lchown
end
def check_have_lchown?