1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 01:50:53 +09:00

Use IsOSPlatform instead of checking for /proc (#101547)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
This commit is contained in:
Adeel Mujahid 2024-06-04 08:49:06 +03:00 committed by GitHub
parent 9d02188cdd
commit 7803a96303
Signed by: github
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// The MIT License(MIT) // The MIT License(MIT)
@ -31,13 +31,15 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
namespace Mono.Linker.Tests.Extensions namespace Mono.Linker.Tests.Extensions
{ {
public class NPath : IEquatable<NPath>, IComparable public class NPath : IEquatable<NPath>, IComparable
{ {
private static readonly StringComparison PathStringComparison = IsLinux () ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; private static readonly StringComparison PathStringComparison = RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ?
StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
private readonly string[] _elements; private readonly string[] _elements;
private readonly bool _isRelative; private readonly bool _isRelative;
@ -804,11 +806,6 @@ namespace Mono.Linker.Tests.Extensions
{ {
return true; return true;
} }
private static bool IsLinux ()
{
return Directory.Exists ("/proc");
}
} }
public static class Extensions public static class Extensions