File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/libraries/System.Memory/src/System/Buffers Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,6 @@ private static TryGetNextBufferResult TryGetNextBuffer(in ReadOnlySequence<T> se
330330 {
331331 while ( ! ReferenceEquals ( segment , endObject ) && ( @object = segment = segment ! . Next ) is not null )
332332 {
333- result = TryGetNextBufferResult . FailureAllRemainingSegmentsEmpty ; // until we know otherwise
334333 buffer = segment ! . Memory . Span ;
335334
336335 if ( ReferenceEquals ( segment , endObject ) )
@@ -344,6 +343,9 @@ private static TryGetNextBufferResult TryGetNextBuffer(in ReadOnlySequence<T> se
344343 result = TryGetNextBufferResult . SuccessHaveData ;
345344 break ;
346345 }
346+
347+ // tell the caller that we *had* more segments (and have advanced), even if not useful
348+ result = TryGetNextBufferResult . FailureAllRemainingSegmentsEmpty ;
347349 }
348350 }
349351 return result ;
@@ -387,7 +389,7 @@ internal void AdvanceCurrentSpan(long count)
387389 AssertValidPosition ( ) ;
388390 }
389391
390- [ MethodImpl ( MethodImplOptions . NoInlining ) ] // avoid what looks like a JIT regression with it inlining this too much from Advance
392+ [ MethodImpl ( MethodImplOptions . NoInlining ) ] // avoid inlining this too much from Advance
391393 private void AdvanceToNextSpan ( long count )
392394 {
393395 AssertValidPosition ( ) ;
You can’t perform that action at this time.
0 commit comments