Skip to content

Commit

Permalink
Better optimizations for NET Core 8
Browse files Browse the repository at this point in the history
  • Loading branch information
imperugo committed Dec 23, 2023
1 parent 4dcc368 commit 44448a2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Task<bool> HashExistsAsync(string hashKey, string key, CommandFlags comma
/// <inheritdoc/>
public async Task<IDictionary<string, T?>> HashGetAsync<T>(string hashKey, string[] keys, CommandFlags commandFlags = CommandFlags.None)
{
#if NET7_0 || NET6_0
#if NET8_0 || NET7_0 || NET6_0

This comment has been minimized.

Copy link
@LeaFrock

LeaFrock Dec 25, 2023

Collaborator

Why not just NET6_0_OR_GREATER?

var concurrent = new ConcurrentDictionary<string, T?>();

await Parallel.ForEachAsync(keys, async (key, token) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

#if NET7_0
#if NET8_0 || NET7_0

This comment has been minimized.

Copy link
@LeaFrock

LeaFrock Dec 25, 2023

Collaborator

NET7_0_OR_GREATER instead.

using MemoryPack;
#endif

namespace StackExchange.Redis.Extensions.Tests.Helpers;

[Serializable]
[DataContract]
#if NET7_0
#if NET8_0 || NET7_0
[MemoryPackable]
public partial class ComplexClassForTest<T, TK> : IEquatable<ComplexClassForTest<T, TK>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

#if NET7_0
#if NET8_0 || NET7_0
using MemoryPack;
#endif

namespace StackExchange.Redis.Extensions.Tests.Helpers;

[Serializable]
[DataContract]
#if NET7_0
#if NET8_0 || NET7_0
[MemoryPackable]
public partial class TestClass<T> : IEquatable<TestClass<T>>
{
{
[MemoryPackConstructor]
#else
public class TestClass<T> : IEquatable<TestClass<T>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Ugo Lattanzi. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

#if NET7_0
#if NET8_0 || NET7_0
using StackExchange.Redis.Extensions.MemoryPack;

namespace StackExchange.Redis.Extensions.Core.Tests.Serializers;
Expand Down

0 comments on commit 44448a2

Please sign in to comment.