From 707d3ab9e4528b0c2bc91321f833ad48964c1183 Mon Sep 17 00:00:00 2001 From: InCerry Date: Tue, 29 Nov 2022 13:57:24 +0800 Subject: [PATCH] Use `NET6_0_OR_GREATER` instead of `(NET6_0 || NET7_0)` --- .../Configurations/FasterKvCacheOptions.cs | 2 +- src/FasterKv.Cache.Core/Guards.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/FasterKv.Cache.Core/Configurations/FasterKvCacheOptions.cs b/src/FasterKv.Cache.Core/Configurations/FasterKvCacheOptions.cs index 71171ba..0272c01 100644 --- a/src/FasterKv.Cache.Core/Configurations/FasterKvCacheOptions.cs +++ b/src/FasterKv.Cache.Core/Configurations/FasterKvCacheOptions.cs @@ -48,7 +48,7 @@ public class FasterKvCacheOptions /// /// Default: {CurrentDirectory}/FasterKvCache/{Environment.ProcessId}-HLog public string LogPath { get; set; } = -#if (NET6_0 || NET7_0) +#if NET6_0_OR_GREATER Path.Combine(Environment.CurrentDirectory, $"FasterKvCache/{Environment.ProcessId}-HLog"); #else Path.Combine(Environment.CurrentDirectory, diff --git a/src/FasterKv.Cache.Core/Guards.cs b/src/FasterKv.Cache.Core/Guards.cs index 6c0923d..3afc6cd 100644 --- a/src/FasterKv.Cache.Core/Guards.cs +++ b/src/FasterKv.Cache.Core/Guards.cs @@ -1,6 +1,6 @@ using System; using System.Runtime.CompilerServices; -#if (NET6_0 || NET7_0) +#if NET6_0_OR_GREATER using System.Diagnostics.CodeAnalysis; #endif @@ -18,11 +18,11 @@ public static class Guards /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T ArgumentNotNull( -#if (NET6_0 || NET7) +#if NET6_0_OR_GREATER [NotNull] #endif this T? obj, -#if (NET6_0 || NET7) +#if NET6_0_OR_GREATER [CallerArgumentExpression(nameof(obj))] #endif string? name = null) @@ -38,11 +38,11 @@ public static T ArgumentNotNull( /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string ArgumentNotNullOrEmpty( -#if (NET6_0 || NET7) +#if NET6_0_OR_GREATER [NotNull] #endif this string? obj, -#if (NET6_0 || NET7) +#if NET6_0_OR_GREATER [CallerArgumentExpression(nameof(obj))] #endif string? name = null) @@ -55,7 +55,7 @@ public static string ArgumentNotNullOrEmpty( /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsNullOrEmpty( -#if (NET6_0 || NET7_0) +#if NET6_0_OR_GREATER [NotNullWhen(false)] #endif this string? str) @@ -68,7 +68,7 @@ public static bool IsNullOrEmpty( /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool NotNullOrEmpty( -#if (NET6_0 || NET7_0) +#if NET6_0_OR_GREATER [NotNullWhen(true)] #endif this string? str)