Skip to content

Commit

Permalink
Remove nonsensical comments about fixed statement (#46013)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtqqczze authored Dec 14, 2020
1 parent d0121ea commit 8d6e098
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,6 @@ private static unsafe int ReadFileNative(IntPtr hFile, Span<byte> buffer, bool i

private static unsafe int WriteFileNative(IntPtr hFile, ReadOnlySpan<byte> bytes, bool useFileAPIs)
{
// You can't use the fixed statement on an array of length 0.
if (bytes.IsEmpty)
return Interop.Errors.ERROR_SUCCESS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ private unsafe int ReadFileNative(SafePipeHandle handle, Span<byte> buffer, Nati
DebugAssertHandleValid(handle);
Debug.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter screwup in call to ReadFileNative.");

// You can't use the fixed statement on an array of length 0. Note that async callers
// check to avoid calling this first, so they can call user's callback
// Note that async callers check to avoid calling this first, so they can call user's callback.
if (buffer.Length == 0)
{
errorCode = 0;
Expand Down Expand Up @@ -360,8 +359,7 @@ private unsafe int WriteFileNative(SafePipeHandle handle, ReadOnlySpan<byte> buf
DebugAssertHandleValid(handle);
Debug.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter screwup in call to WriteFileNative.");

// You can't use the fixed statement on an array of length 0. Note that async callers
// check to avoid calling this first, so they can call user's callback
// Note that async callers check to avoid calling this first, so they can call user's callback.
if (buffer.Length == 0)
{
errorCode = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,6 @@ private unsafe int ReadFileNative(byte[] bytes, int offset, int count, NativeOve
if (bytes.Length - offset < count)
throw new IndexOutOfRangeException(SR.IndexOutOfRange_IORaceCondition);

// You can't use the fixed statement on an array of length 0.
if (bytes.Length == 0)
{
hr = 0;
Expand Down Expand Up @@ -1461,7 +1460,6 @@ private unsafe int WriteFileNative(byte[] bytes, int offset, int count, NativeOv
if (bytes.Length - offset < count)
throw new IndexOutOfRangeException(SR.IndexOutOfRange_IORaceCondition);

// You can't use the fixed statement on an array of length 0.
if (bytes.Length == 0)
{
hr = 0;
Expand Down

0 comments on commit 8d6e098

Please sign in to comment.