Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<Rule Id="CA1832" Action="Warning" /> <!-- Use AsSpan or AsMemory instead of Range-based indexers when appropriate -->
<Rule Id="CA1833" Action="Warning" /> <!-- Use AsSpan or AsMemory instead of Range-based indexers when appropriate -->
<Rule Id="CA1834" Action="Info" /> <!-- Consider using 'StringBuilder.Append(char)' when applicable. -->
<Rule Id="CA1835" Action="Info" /> <!-- Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' -->
<Rule Id="CA1835" Action="Warning" /> <!-- Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' -->
<Rule Id="CA1836" Action="Info" /> <!-- Prefer IsEmpty over Count -->
<Rule Id="CA1837" Action="Info" /> <!-- Use 'Environment.ProcessId' -->
<Rule Id="CA1838" Action="Info" /> <!-- Avoid 'StringBuilder' parameters for P/Invokes -->
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/CommunicationsUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ internal static async Task<int> ReadAsync(Stream stream, byte[] buffer, int byte
int totalBytesRead = 0;
while (totalBytesRead < bytesToRead)
{
int bytesRead = await stream.ReadAsync(buffer, totalBytesRead, bytesToRead - totalBytesRead);
int bytesRead = await stream.ReadAsync(buffer.AsMemory(totalBytesRead, bytesToRead - totalBytesRead), new CancellationToken());
if (bytesRead == 0)
{
return totalBytesRead;
Expand Down