Skip to content

Commit

Permalink
Fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thompson-tomo committed Jun 5, 2024
1 parent c4bb2f0 commit bc9ab4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Authors>James Turner</Authors>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard6.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Text.Json" Version="6.0.8" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/CacheTower/Internal/CacheEntryKeyLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public bool AcquireLock(string cacheKey)
keyLocks[cacheKey] = null;
}
return hasLock;
#elif NETSTANDARD2_1
#else
return keyLocks.TryAdd(cacheKey, null);
#endif
}
Expand Down Expand Up @@ -56,7 +56,7 @@ private bool TryRemove(string cacheKey, out TaskCompletionSource<ICacheEntry>? c
return true;
}
return false;
#elif NETSTANDARD2_1
#else
return keyLocks.Remove(cacheKey, out completionSource);
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions src/CacheTower/Internal/MD5HashUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static unsafe string ComputeHash(string value)
var bytes = Encoding.UTF8.GetBytes(value);
var hashBytes = HashAlgorithm.ComputeHash(bytes);

#elif NETSTANDARD2_1
#else
public static unsafe string ComputeHash(ReadOnlySpan<char> value)
{
var encoding = Encoding.UTF8;
Expand All @@ -29,9 +29,9 @@ public static unsafe string ComputeHash(ReadOnlySpan<char> value)
HashAlgorithm.TryComputeHash(bytes, hashBytes, out var _);
#endif

//Based on byte conversion implementation in BitConverter (but with the dash stripped)
//https://github.com/dotnet/coreclr/blob/fbc11ea6afdaa2fe7b9377446d6bb0bd447d5cb5/src/mscorlib/shared/System/BitConverter.cs#L409-L440
static char GetHexValue(int i)
//Based on byte conversion implementation in BitConverter (but with the dash stripped)
//https://github.com/dotnet/coreclr/blob/fbc11ea6afdaa2fe7b9377446d6bb0bd447d5cb5/src/mscorlib/shared/System/BitConverter.cs#L409-L440
static char GetHexValue(int i)
{
if (i < 10)
{
Expand Down

0 comments on commit bc9ab4c

Please sign in to comment.