diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-05-01 13:39:03 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-05-08 19:02:44 +0900 |
| commit | 4e243c709e45eb0d115b7875cae25dff86184b59 (patch) | |
| tree | cfc3ca83847bcfd53f86158e693306459236292b | |
| parent | 0f618b87d55808b507d9a623116f62a4df655384 (diff) | |
pathname: Remove unneeded constant
`SEPARATOR_LIST` is used only to initialize `SEPARATOR_PAT`.
| -rw-r--r-- | pathname_builtin.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 60f936632f..d3da315872 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -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. |
