[#28] Client: Apply code optimizations

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-11-18 16:57:20 +03:00
parent 766f61a5f7
commit 749000a090
57 changed files with 845 additions and 1116 deletions

View file

@ -11,9 +11,7 @@ public static class UUIDExtension
if (id == null)
throw new ArgumentNullException(nameof(id));
var bytes = id.ToByteArray();
var orderedBytes = GetGuidBytesDirectOrder(bytes);
var orderedBytes = GetGuidBytesDirectOrder(id.Span);
return new Guid(orderedBytes);
}
@ -32,7 +30,7 @@ public static class UUIDExtension
return orderedBytes;
}
private static byte[] GetGuidBytesDirectOrder(byte[] source)
private static byte[] GetGuidBytesDirectOrder(ReadOnlySpan<byte> source)
{
if (source.Length != 16)
throw new ArgumentException("Wrong uuid binary format");