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

@@ -165,10 +165,10 @@ namespace Spectre.Console
{
int? GetLinkHashCode()
{
#if NET5_0
return Link?.GetHashCode(StringComparison.Ordinal);
#else
#if NETSTANDARD2_0
return Link?.GetHashCode();
#else
return Link?.GetHashCode(StringComparison.Ordinal);
#endif
}