Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BitFaster.Caching.Benchmarks/DrainBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void Add()
public void DrainArray()
{
Add();
#if NETCOREAPP3_1_OR_GREATER
#if NET
buffer.DrainTo(output.AsSpan());
#else
buffer.DrainTo(new ArraySegment<string>(output));
Expand Down
8 changes: 4 additions & 4 deletions BitFaster.Caching.Benchmarks/Lfu/CmSketchFlat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

#if NETCOREAPP3_1_OR_GREATER
#if NET
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
#endif
Expand Down Expand Up @@ -53,7 +53,7 @@ public CmSketchFlat(long maximumSize, IEqualityComparer<T> comparer)
/// <returns>The estimated frequency of the value.</returns>
public int EstimateFrequency(T value)
{
#if !NETCOREAPP3_1_OR_GREATER
#if !NET
return EstimateFrequencyStd(value);
#else

Expand All @@ -76,7 +76,7 @@ public int EstimateFrequency(T value)
/// <param name="value">The value.</param>
public void Increment(T value)
{
#if !NETCOREAPP3_1_OR_GREATER
#if !NET
IncrementStd(value);
#else

Expand Down Expand Up @@ -207,7 +207,7 @@ private int Spread(int x)
return (int)((y >> 16) ^ y);
}

#if NETCOREAPP3_1_OR_GREATER
#if NET
private unsafe int EstimateFrequencyAvx(T value)
{
int hash = Spread(comparer.GetHashCode(value));
Expand Down
4 changes: 2 additions & 2 deletions BitFaster.Caching.Benchmarks/Lfu/CmSketchNoPin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public CmSketchNoPin(long maximumSize, IEqualityComparer<T> comparer)
/// <returns>The estimated frequency of the value.</returns>
public int EstimateFrequency(T value)
{
#if NET48
#if NETFRAMEWORK
return EstimateFrequencyStd(value);
#else

Expand Down Expand Up @@ -86,7 +86,7 @@ public int EstimateFrequency(T value)
/// <param name="value">The value.</param>
public void Increment(T value)
{
#if NET48
#if NETFRAMEWORK
IncrementStd(value);
#else

Expand Down
4 changes: 2 additions & 2 deletions BitFaster.Caching.UnitTests/CacheEventsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace BitFaster.Caching.UnitTests
{
// backcompat: remove
#if NETCOREAPP3_1_OR_GREATER
// backcompat: remove
#if NET
public class CacheEventsTests
{
[Fact]
Expand Down
4 changes: 2 additions & 2 deletions BitFaster.Caching.UnitTests/CacheMetricsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

namespace BitFaster.Caching.UnitTests
{
// backcompat: remove
#if NETCOREAPP3_1_OR_GREATER
// backcompat: remove
#if NET
public class CacheMetricsTests
{
[Fact]
Expand Down
2 changes: 1 addition & 1 deletion BitFaster.Caching.UnitTests/Intrinsics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class Intrinsics
{
public static void SkipAvxIfNotSupported<I>()
{
#if NETCOREAPP3_1_OR_GREATER
#if NET
#if NET6_0_OR_GREATER
// when we are trying to test Avx2/Arm64, skip the test if it's not supported
Skip.If(typeof(I) == typeof(DetectIsa) && !(Avx2.IsSupported || AdvSimd.Arm64.IsSupported));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NETCOREAPP3_1_OR_GREATER
#if NET

using FluentAssertions;
using BitFaster.Caching.Lru;
Expand Down
2 changes: 1 addition & 1 deletion BitFaster.Caching.UnitTests/Lru/TelemetryPolicyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void WhenEventSourceIsSetItemUpdatedEventUsesSource()
}

// backcompat: remove
#if NETCOREAPP3_1_OR_GREATER
#if NET
[Fact]
public void WhenInterfaceDefaultItemUpdatedRegisteredNoOp()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace BitFaster.Caching.UnitTests.Lru
{
// backcompat: remove conditional compile
#if !NETCOREAPP3_1_OR_GREATER
#if !NET
public class TlruStopwatchPolicyTests
{
private readonly TLruLongTicksPolicy<int, int> policy = new TLruLongTicksPolicy<int, int>(TimeSpan.FromSeconds(10));
Expand Down
Loading