Remove a few unnecessary !s (dotnet/corefx#39531)
authorStephen Toub <stoub@microsoft.com>
Tue, 16 Jul 2019 15:10:12 +0000 (11:10 -0400)
committerGitHub <noreply@github.com>
Tue, 16 Jul 2019 15:10:12 +0000 (11:10 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/2b6f38911bb45548c8d1db015526518276e6c888

src/libraries/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs
src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.Helpers.cs
src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs

index 4c2a083..bb8ea32 100644 (file)
@@ -25,7 +25,7 @@ namespace System.Buffers
                         ThrowHelper.ThrowObjectDisposedException_ArrayMemoryPoolBuffer();
                     }
 
-                    return new Memory<T>(array!); // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
+                    return new Memory<T>(array);
                 }
             }
 
index c01f26a..c41e680 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Buffers
                     if (nextSegment == null)
                         ThrowHelper.ThrowInvalidOperationException_EndPositionNotReached();
 
-                    next = new SequencePosition(nextSegment!, 0); // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
+                    next = new SequencePosition(nextSegment, 0);
                     memory = startSegment.Memory.Slice(startIndex);
                 }
                 else
index 0f6bb1f..6a84d07 100644 (file)
@@ -118,8 +118,8 @@ namespace System.Buffers
             if (array == null)
                 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
 
-            _startObject = array!; // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
-            _endObject = array!; // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
+            _startObject = array;
+            _endObject = array;
             _startInteger = ReadOnlySequence.ArrayToSequenceStart(0);
             _endInteger = ReadOnlySequence.ArrayToSequenceEnd(array!.Length); // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
         }