Skip to content

Commit

Permalink
Perf | avoid copying of an array for SqlGuid in TdsParser (dotnet#2308)
Browse files Browse the repository at this point in the history
similar how it's don for netfx
  • Loading branch information
wilbit committed Jan 19, 2024
1 parent 1f4676d commit f1282f4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5932,7 +5932,11 @@ internal bool DeserializeUnencryptedValue(SqlBuffer value, byte[] unencryptedByt
case TdsEnums.SQLUNIQUEID:
{
Debug.Assert(length == 16, "invalid length for SqlGuid type!");
#if NET8_0_OR_GREATER
value.SqlGuid = new SqlGuid(unencryptedBytes); // doesn't copy the byte array
#else
value.SqlGuid = SqlTypeWorkarounds.SqlGuidCtor(unencryptedBytes, true); // doesn't copy the byte array
#endif
break;
}

Expand Down

0 comments on commit f1282f4

Please sign in to comment.