mirror of
https://github.com/ruby/ruby.git
synced 2026-08-11 18:29:13 +08:00
pathname: Remove unneeded constant
`SEPARATOR_LIST` is used only to initialize `SEPARATOR_PAT`.
This commit is contained in:
parent
0f618b87d5
commit
4e243c709e
Notes:
git
2026-05-08 10:37:24 +00:00
@ -349,16 +349,15 @@ class Pathname
|
||||
|
||||
if File::ALT_SEPARATOR
|
||||
# Separator list string.
|
||||
SEPARATOR_LIST = Regexp.quote "#{File::ALT_SEPARATOR}#{File::SEPARATOR}"
|
||||
separator_list = Regexp.quote "#{File::ALT_SEPARATOR}#{File::SEPARATOR}"
|
||||
# Regexp that matches a separator.
|
||||
SEPARATOR_PAT = /[#{SEPARATOR_LIST}]/
|
||||
SEPARATOR_PAT = /[#{separator_list}]/
|
||||
else
|
||||
SEPARATOR_LIST = Regexp.quote File::SEPARATOR
|
||||
SEPARATOR_PAT = /#{SEPARATOR_LIST}/
|
||||
separator_list = Regexp.quote File::SEPARATOR
|
||||
SEPARATOR_PAT = /#{separator_list}/
|
||||
end
|
||||
SEPARATOR_LIST.freeze
|
||||
SEPARATOR_PAT.freeze
|
||||
private_constant :SEPARATOR_LIST, :SEPARATOR_LIST
|
||||
private_constant :SEPARATOR_PAT
|
||||
|
||||
if File.dirname('A:') == 'A:.' # DOSish drive letter
|
||||
# Regexp that matches an absolute path.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user