Skip to content

Commit

Permalink
Perf | used Array.Empty<byte>() as a buffer for null values in SqlDat…
Browse files Browse the repository at this point in the history
…aReader and ValueUtilsSmi (#2308)
  • Loading branch information
wilbit committed Jan 19, 2024
1 parent 2f8c574 commit f856e2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ virtual public XmlReader GetXmlReader(int i)
if (_data[i].IsNull)
{
// A 'null' stream
return SqlTypeWorkarounds.SqlXmlCreateSqlXmlReader(new MemoryStream(new byte[0], writable: false), closeInput: true, async: false);
return SqlTypeWorkarounds.SqlXmlCreateSqlXmlReader(new MemoryStream(Array.Empty<byte>(), writable: false), closeInput: true, async: false);
}
else
{
Expand Down Expand Up @@ -1765,7 +1765,7 @@ override public Stream GetStream(int i)
if (_data[i].IsNull)
{
// A 'null' stream
data = new byte[0];
data = Array.Empty<byte>();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal static Stream GetStream(SmiEventSink_Default sink, ITypedGettersV3 gett
if (isDbNull)
{
// "null" stream
data = new byte[0];
data = Array.Empty<byte>();
}
else
{
Expand Down

0 comments on commit f856e2b

Please sign in to comment.