Skip to content

Commit 9b8f3a4

Browse files
committed
Use stackalloc expressions.
1 parent af2acbc commit 9b8f3a4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/MySqlConnector/Core/Row.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,9 @@ protected static Guid CreateGuidFromBytes(MySqlGuidFormat guidFormat, ReadOnlySp
425425
unsafe
426426
{
427427
if (guidFormat == MySqlGuidFormat.Binary16)
428-
{
429-
ReadOnlySpan<byte> guid = stackalloc byte[16] { bytes[3], bytes[2], bytes[1], bytes[0], bytes[5], bytes[4], bytes[7], bytes[6], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] };
430-
return new Guid(guid);
431-
}
428+
return new Guid(stackalloc byte[16] { bytes[3], bytes[2], bytes[1], bytes[0], bytes[5], bytes[4], bytes[7], bytes[6], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] });
432429
if (guidFormat == MySqlGuidFormat.TimeSwapBinary16)
433-
{
434-
ReadOnlySpan<byte> guid = stackalloc byte[16] { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] };
435-
return new Guid(guid);
436-
}
430+
return new Guid(stackalloc byte[16] { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] });
437431
return new Guid(bytes);
438432
}
439433
#endif

0 commit comments

Comments
 (0)