Skip to content

Commit 1bafa48

Browse files
authored
cleanup preprocessor directives (#695)
1 parent eef629a commit 1bafa48

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

BitFaster.Caching.Benchmarks/DrainBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public void Add()
187187
public void DrainArray()
188188
{
189189
Add();
190-
#if NETCOREAPP3_1_OR_GREATER
190+
#if NET
191191
buffer.DrainTo(output.AsSpan());
192192
#else
193193
buffer.DrainTo(new ArraySegment<string>(output));

BitFaster.Caching.Benchmarks/Lfu/CmSketchFlat.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text;
55
using System.Threading.Tasks;
66

7-
#if NETCOREAPP3_1_OR_GREATER
7+
#if NET
88
using System.Runtime.Intrinsics;
99
using System.Runtime.Intrinsics.X86;
1010
#endif
@@ -53,7 +53,7 @@ public CmSketchFlat(long maximumSize, IEqualityComparer<T> comparer)
5353
/// <returns>The estimated frequency of the value.</returns>
5454
public int EstimateFrequency(T value)
5555
{
56-
#if !NETCOREAPP3_1_OR_GREATER
56+
#if !NET
5757
return EstimateFrequencyStd(value);
5858
#else
5959

@@ -76,7 +76,7 @@ public int EstimateFrequency(T value)
7676
/// <param name="value">The value.</param>
7777
public void Increment(T value)
7878
{
79-
#if !NETCOREAPP3_1_OR_GREATER
79+
#if !NET
8080
IncrementStd(value);
8181
#else
8282

@@ -207,7 +207,7 @@ private int Spread(int x)
207207
return (int)((y >> 16) ^ y);
208208
}
209209

210-
#if NETCOREAPP3_1_OR_GREATER
210+
#if NET
211211
private unsafe int EstimateFrequencyAvx(T value)
212212
{
213213
int hash = Spread(comparer.GetHashCode(value));

BitFaster.Caching.Benchmarks/Lfu/CmSketchNoPin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public CmSketchNoPin(long maximumSize, IEqualityComparer<T> comparer)
5757
/// <returns>The estimated frequency of the value.</returns>
5858
public int EstimateFrequency(T value)
5959
{
60-
#if NET48
60+
#if NETFRAMEWORK
6161
return EstimateFrequencyStd(value);
6262
#else
6363

@@ -86,7 +86,7 @@ public int EstimateFrequency(T value)
8686
/// <param name="value">The value.</param>
8787
public void Increment(T value)
8888
{
89-
#if NET48
89+
#if NETFRAMEWORK
9090
IncrementStd(value);
9191
#else
9292

BitFaster.Caching.UnitTests/CacheEventsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace BitFaster.Caching.UnitTests
66
{
7-
// backcompat: remove
8-
#if NETCOREAPP3_1_OR_GREATER
7+
// backcompat: remove
8+
#if NET
99
public class CacheEventsTests
1010
{
1111
[Fact]

BitFaster.Caching.UnitTests/CacheMetricsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
namespace BitFaster.Caching.UnitTests
77
{
8-
// backcompat: remove
9-
#if NETCOREAPP3_1_OR_GREATER
8+
// backcompat: remove
9+
#if NET
1010
public class CacheMetricsTests
1111
{
1212
[Fact]

BitFaster.Caching.UnitTests/Intrinsics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class Intrinsics
1313
{
1414
public static void SkipAvxIfNotSupported<I>()
1515
{
16-
#if NETCOREAPP3_1_OR_GREATER
16+
#if NET
1717
#if NET6_0_OR_GREATER
1818
// when we are trying to test Avx2/Arm64, skip the test if it's not supported
1919
Skip.If(typeof(I) == typeof(DetectIsa) && !(Avx2.IsSupported || AdvSimd.Arm64.IsSupported));

BitFaster.Caching.UnitTests/Lru/TLruTickCount64PolicyTests .cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETCOREAPP3_1_OR_GREATER
1+
#if NET
22

33
using FluentAssertions;
44
using BitFaster.Caching.Lru;

BitFaster.Caching.UnitTests/Lru/TelemetryPolicyTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void WhenEventSourceIsSetItemUpdatedEventUsesSource()
148148
}
149149

150150
// backcompat: remove
151-
#if NETCOREAPP3_1_OR_GREATER
151+
#if NET
152152
[Fact]
153153
public void WhenInterfaceDefaultItemUpdatedRegisteredNoOp()
154154
{

BitFaster.Caching.UnitTests/Lru/TlruStopwatchPolicyTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace BitFaster.Caching.UnitTests.Lru
1010
{
1111
// backcompat: remove conditional compile
12-
#if !NETCOREAPP3_1_OR_GREATER
12+
#if !NET
1313
public class TlruStopwatchPolicyTests
1414
{
1515
private readonly TLruLongTicksPolicy<int, int> policy = new TLruLongTicksPolicy<int, int>(TimeSpan.FromSeconds(10));

0 commit comments

Comments
 (0)