From: Stephen Toub Date: Tue, 16 Jul 2019 15:10:12 +0000 (-0400) Subject: Remove a few unnecessary !s (dotnet/corefx#39531) X-Git-Tag: submit/tizen/20210909.063632~11031^2~918 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=625eca6c4b15dc65beb6fe8809a1fc65d50e5113;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove a few unnecessary !s (dotnet/corefx#39531) Commit migrated from https://github.com/dotnet/corefx/commit/2b6f38911bb45548c8d1db015526518276e6c888 --- diff --git a/src/libraries/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs b/src/libraries/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs index 4c2a083..bb8ea32 100644 --- a/src/libraries/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs +++ b/src/libraries/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs @@ -25,7 +25,7 @@ namespace System.Buffers ThrowHelper.ThrowObjectDisposedException_ArrayMemoryPoolBuffer(); } - return new Memory(array!); // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected + return new Memory(array); } } diff --git a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.Helpers.cs b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.Helpers.cs index c01f26a..c41e680 100644 --- a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.Helpers.cs +++ b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.Helpers.cs @@ -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 diff --git a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs index 0f6bb1f..6a84d07 100644 --- a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs +++ b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs @@ -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 }