Skip to content

Commit

Permalink
Update GuidPolyfill.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 29, 2024
1 parent 72cdae6 commit 24c930e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Polyfill/GuidPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ static partial class GuidPolyfill
/// </summary>
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.guid.tryparse#system-guid-tryparse(system-string-system-iformatprovider-system-guid@)")]
public static bool TryParse(string? target, IFormatProvider? provider, out Guid result) =>
#if !NET7_0_OR_GREATER
Guid.TryParse(target, out result);
#else
#if NET7_0_OR_GREATER
Guid.TryParse(target, provider, out result);
#else
Guid.TryParse(target, out result);
#endif

#if FeatureMemory
Expand All @@ -34,10 +34,10 @@ public static bool TryParse(string? target, IFormatProvider? provider, out Guid
/// </summary>
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.byte.tryparse#system-byte-tryparse(system-readonlyspan((system-byte))-system-iformatprovider-system-byte@)")]
public static bool TryParse(ReadOnlySpan<byte> target, IFormatProvider? provider, out byte result) =>
#if !NET8_0_OR_GREATER
byte.TryParse(Encoding.UTF8.GetString(target.ToArray()), NumberStyles.Integer, provider, out result);
#else
#if NET8_0_OR_GREATER
byte.TryParse(target, provider, out result);
#else
byte.TryParse(Encoding.UTF8.GetString(target.ToArray()), NumberStyles.Integer, provider, out result);
#endif

#endif
Expand Down

0 comments on commit 24c930e

Please sign in to comment.