File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
Microsoft.Toolkit.Mvvm/Messaging Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 88using System . Buffers ;
99using System . Collections . Generic ;
1010using System . Runtime . CompilerServices ;
11- using System . Runtime . InteropServices ;
1211using Microsoft . Collections . Extensions ;
1312using Microsoft . Toolkit . Mvvm . Messaging . Internals ;
1413
@@ -293,7 +292,7 @@ public void Reset()
293292 /// A simple buffer writer implementation using pooled arrays.
294293 /// </summary>
295294 /// <typeparam name="T">The type of items to store in the list.</typeparam>
296- public sealed class ArrayPoolBufferWriter < T > : IDisposable
295+ private sealed class ArrayPoolBufferWriter < T > : IDisposable
297296 {
298297 /// <summary>
299298 /// The default buffer size to use to expand empty arrays.
@@ -325,17 +324,7 @@ public ArrayPoolBufferWriter()
325324 public ReadOnlySpan < T > Span
326325 {
327326 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
328- get
329- {
330- T [ ] array = this . array ;
331-
332- if ( this . index > 0 )
333- {
334- return MemoryMarshal . CreateReadOnlySpan ( ref array [ 0 ] , this . index ) ;
335- }
336-
337- return default ;
338- }
327+ get => this . array . AsSpan ( 0 , this . index ) ;
339328 }
340329
341330 /// <summary>
You can’t perform that action at this time.
0 commit comments