This commit is contained in:
Jeremy Koritzinsky 2022-03-28 11:32:33 -07:00
Родитель 888a7706fd
Коммит 40a2f20234
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0C331C376E93831A
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -1273,11 +1273,13 @@ namespace Microsoft.CodeAnalysis.Testing
static (string fileName, IEnumerable<string> folders) GetNameAndFoldersFromPath(string path) static (string fileName, IEnumerable<string> folders) GetNameAndFoldersFromPath(string path)
{ {
string fileName = Path.GetFileName(path); string fileName = Path.GetFileName(path);
string[] folders = Path.GetDirectoryName(path)!.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries); string[] folders = Path.GetDirectoryName(path)!.Split(PathSplitChars, StringSplitOptions.RemoveEmptyEntries);
return (fileName, folders); return (fileName, folders);
} }
} }
private static readonly char[] PathSplitChars = new[] { Path.DirectorySeparatorChar };
/// <summary> /// <summary>
/// Creates a solution that will be used as parent for the sources that need to be checked. /// Creates a solution that will be used as parent for the sources that need to be checked.
/// </summary> /// </summary>