[#28] Client: Apply code optimizations
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
766f61a5f7
commit
749000a090
57 changed files with 845 additions and 1116 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue