From d6e75c71b58e0f5bca9405f289a47f53f31761c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Mon, 16 Dec 2024 08:50:01 +0100 Subject: [PATCH] refactor: Embed object storage improvements --- Adaptors/Embed/src/ObjectStorage.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Adaptors/Embed/src/ObjectStorage.cs b/Adaptors/Embed/src/ObjectStorage.cs index bc4ea87b5..8bb28d693 100644 --- a/Adaptors/Embed/src/ObjectStorage.cs +++ b/Adaptors/Embed/src/ObjectStorage.cs @@ -17,7 +17,7 @@ using System; using System.Collections.Generic; -using System.Runtime.CompilerServices; +using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -67,18 +67,17 @@ public Task Check(HealthCheckTag tag) await foreach (var val in valueChunks.WithCancellation(cancellationToken) .ConfigureAwait(false)) { - array.AddRange(val.ToArray()); + array.AddRange(val.Span); } return (array.ToArray(), array.Count); } /// - public async IAsyncEnumerable GetValuesAsync(byte[] id, - [EnumeratorCancellation] CancellationToken cancellationToken = default) - { - yield return id; - } + public IAsyncEnumerable GetValuesAsync(byte[] id, + CancellationToken cancellationToken = default) + => AsyncEnumerable.Repeat(id, + 1); /// public Task TryDeleteAsync(IEnumerable ids,