From 5008d97d7e77d8886e90eb067961d36091f32204 Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Fri, 27 Dec 2024 13:01:41 +0900 Subject: [PATCH 1/2] Update TargetFrameworks (net6.0,net8.0 -> net8.0,net9.0) --- .../Multicaster.Distributed.Nats.csproj | 2 +- .../Multicaster.Distributed.Redis.csproj | 2 +- src/Multicaster/Multicaster.csproj | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Multicaster.Distributed.Nats/Multicaster.Distributed.Nats.csproj b/src/Multicaster.Distributed.Nats/Multicaster.Distributed.Nats.csproj index 6bb685e..f25f12a 100644 --- a/src/Multicaster.Distributed.Nats/Multicaster.Distributed.Nats.csproj +++ b/src/Multicaster.Distributed.Nats/Multicaster.Distributed.Nats.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 enable enable diff --git a/src/Multicaster.Distributed.Redis/Multicaster.Distributed.Redis.csproj b/src/Multicaster.Distributed.Redis/Multicaster.Distributed.Redis.csproj index e039436..daf2cf4 100644 --- a/src/Multicaster.Distributed.Redis/Multicaster.Distributed.Redis.csproj +++ b/src/Multicaster.Distributed.Redis/Multicaster.Distributed.Redis.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 enable enable diff --git a/src/Multicaster/Multicaster.csproj b/src/Multicaster/Multicaster.csproj index f6f3612..9fa081e 100644 --- a/src/Multicaster/Multicaster.csproj +++ b/src/Multicaster/Multicaster.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 enable enable @@ -10,11 +10,6 @@ Cysharp.Runtime.Multicast - - - - - TextTemplatingFileGenerator From 0741da5936c3ba4891b0a90dc0247f6893910a17 Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Fri, 27 Dec 2024 13:01:47 +0900 Subject: [PATCH 2/2] Fix warnings --- src/Multicaster.Distributed.Nats/KeyArrayFormatter.cs | 6 ------ src/Multicaster.Distributed.Redis/KeyArrayFormatter.cs | 6 ------ src/Multicaster/Internal/FNV1A32.cs | 10 +++------- .../RemoteClientResultPendingTaskRegistryTest.cs | 2 +- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/Multicaster.Distributed.Nats/KeyArrayFormatter.cs b/src/Multicaster.Distributed.Nats/KeyArrayFormatter.cs index 27232a4..8ee6b35 100644 --- a/src/Multicaster.Distributed.Nats/KeyArrayFormatter.cs +++ b/src/Multicaster.Distributed.Nats/KeyArrayFormatter.cs @@ -9,12 +9,6 @@ internal static class KeyArrayFormatter [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Serialize(ref MessagePackWriter writer, ReadOnlySpan values) { - if (values == null) - { - writer.WriteNil(); - return; - } - writer.WriteArrayHeader(values.Length); foreach (var value in values) { diff --git a/src/Multicaster.Distributed.Redis/KeyArrayFormatter.cs b/src/Multicaster.Distributed.Redis/KeyArrayFormatter.cs index 44420e4..a416ab3 100644 --- a/src/Multicaster.Distributed.Redis/KeyArrayFormatter.cs +++ b/src/Multicaster.Distributed.Redis/KeyArrayFormatter.cs @@ -9,12 +9,6 @@ internal static class KeyArrayFormatter [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Serialize(ref MessagePackWriter writer, ReadOnlySpan values) { - if (values == null) - { - writer.WriteNil(); - return; - } - writer.WriteArrayHeader(values.Length); foreach (var value in values) { diff --git a/src/Multicaster/Internal/FNV1A32.cs b/src/Multicaster/Internal/FNV1A32.cs index 4de7819..4dc352d 100644 --- a/src/Multicaster/Internal/FNV1A32.cs +++ b/src/Multicaster/Internal/FNV1A32.cs @@ -14,14 +14,10 @@ public static int GetHashCode(string str) public static int GetHashCode(ReadOnlySpan obj) { - uint hash = 0; - if (obj != null) + uint hash = 2166136261; + for (int i = 0; i < obj.Length; i++) { - hash = 2166136261; - for (int i = 0; i < obj.Length; i++) - { - hash = unchecked((obj[i] ^ hash) * 16777619); - } + hash = unchecked((obj[i] ^ hash) * 16777619); } return unchecked((int)hash); diff --git a/test/Multicaster.Tests/RemoteClientResultPendingTaskRegistryTest.cs b/test/Multicaster.Tests/RemoteClientResultPendingTaskRegistryTest.cs index a876dd7..646a852 100644 --- a/test/Multicaster.Tests/RemoteClientResultPendingTaskRegistryTest.cs +++ b/test/Multicaster.Tests/RemoteClientResultPendingTaskRegistryTest.cs @@ -49,7 +49,7 @@ public void CancelImmediately_On_Register_When_Disposed() } [Fact] - public async Task Timeout() + public void Timeout() { // Arrange var timeProvider = new FakeTimeProvider();