Future-proof conditional compilation

* Invert `#if NET5_0` conditions so that when adding net6.0 target framework, the _new_ APIs are used.
* Use `NET5_0_OR_GREATER` instead of `NET5_0` to ensure consistent behaviour on future target frameworks.
This commit is contained in:
Cédric Luthi
2021-09-29 09:40:58 +02:00
committed by Patrik Svensson
parent 644fb76d61
commit a5716a35e2
5 changed files with 19 additions and 28 deletions

View File

@ -32,10 +32,10 @@ namespace Spectre.Console
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static int GetLinkHashCode(string link)
{
#if NET5_0
return link.GetHashCode(StringComparison.Ordinal);
#else
#if NETSTANDARD2_0
return link.GetHashCode();
#else
return link.GetHashCode(StringComparison.Ordinal);
#endif
}
}