1- using System . Collections ;
2- using System . Collections . Immutable ;
3-
41namespace Ramstack . Collections ;
52
63/// <summary>
@@ -102,7 +99,8 @@ public ReadOnlyArray(T item1, T item2, T item3, T item4) =>
10299 public ReadOnlyArray ( ReadOnlySpan < T > items )
103100 {
104101 //
105- // Avoid address exposure in cases where the destination local does not actually end up escaping in any way.
102+ // Avoid address exposure in cases where the destination local
103+ // does not actually end up escaping in any way.
106104 // https://github.com/dotnet/runtime/pull/102808
107105 //
108106
@@ -133,7 +131,8 @@ public Enumerator GetEnumerator()
133131 /// </summary>
134132 /// <param name="start">The index at which to begin the slice.</param>
135133 /// <returns>
136- /// A readonly span that consists of all elements of the current array from <paramref name="start"/> to the end.
134+ /// A readonly span that consists of all elements of the current array
135+ /// from <paramref name="start"/> to the end.
137136 /// </returns>
138137 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
139138 public ReadOnlyArray < T > Slice ( int start )
@@ -152,7 +151,8 @@ public ReadOnlyArray<T> Slice(int start)
152151 /// <param name="start">The index at which to begin the slice.</param>
153152 /// <param name="length">The desired length for the slice.</param>
154153 /// <returns>
155- /// A readonly span that consists of <paramref name="length"/> elements from the current array starting at <paramref name="start"/>.
154+ /// A readonly span that consists of <paramref name="length"/> elements
155+ /// from the current array starting at <paramref name="start"/>.
156156 /// </returns>
157157 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
158158 public ReadOnlyArray < T > Slice ( int start , int length )
@@ -188,7 +188,8 @@ public ReadOnlySpan<T> AsSpan() =>
188188 new ( Inner ?? [ ] ) ;
189189
190190 /// <summary>
191- /// Creates a new read-only span over a portion of the current array starting at a specified position to the end of the array.
191+ /// Creates a new read-only span over a portion of the current array
192+ /// starting at a specified position to the end of the array.
192193 /// </summary>
193194 /// <param name="start">The index at which to begin the span.</param>
194195 /// <returns>
@@ -199,7 +200,8 @@ public ReadOnlySpan<T> AsSpan(int start) =>
199200 AsSpan ( ) . Slice ( start ) ;
200201
201202 /// <summary>
202- /// Creates a new read-only span over a portion of the current array starting at a specified position for a specified length.
203+ /// Creates a new read-only span over a portion of the current array
204+ /// starting at a specified position for a specified length.
203205 /// </summary>
204206 /// <param name="start">The index at which to begin the span.</param>
205207 /// <param name="length">The number of items in the span.</param>
@@ -219,7 +221,8 @@ public ArrayView<T> AsView() =>
219221 new ( Inner ?? [ ] ) ;
220222
221223 /// <summary>
222- /// Creates an <see cref="ArrayView{T}"/> over the current array starting at a specified position to the end of the array.
224+ /// Creates an <see cref="ArrayView{T}"/> over the current array
225+ /// starting at a specified position to the end of the array.
223226 /// </summary>
224227 /// <param name="index">The index at which to begin the array view.</param>
225228 /// <returns>
@@ -230,7 +233,8 @@ public ArrayView<T> AsView(int index) =>
230233 AsView ( ) . Slice ( index ) ;
231234
232235 /// <summary>
233- /// Creates an <see cref="ArrayView{T}"/> over the current array starting at a specified position for a specified length.
236+ /// Creates an <see cref="ArrayView{T}"/> over the current array
237+ /// starting at a specified position for a specified length.
234238 /// </summary>
235239 /// <param name="index">The index at which to begin the array view.</param>
236240 /// <param name="count">The number of items in the array view.</param>
@@ -253,7 +257,8 @@ public ReadOnlyMemory<T> AsMemory() =>
253257 /// Returns a reference to the element of the <see cref="ReadOnlyArray{T}"/> at index zero.
254258 /// </summary>
255259 /// <returns>
256- /// A reference to the element of the <see cref="ReadOnlyArray{T}"/> at index zero, or <see langword="null"/> if <see cref="IsDefault"/> is true.
260+ /// A reference to the element of the <see cref="ReadOnlyArray{T}"/> at index zero,
261+ /// or <see langword="null"/> if <see cref="IsDefault"/> is true.
257262 /// </returns>
258263 public ref readonly T GetPinnableReference ( ) =>
259264 ref MemoryMarshal . GetArrayDataReference ( Inner ! ) ;
@@ -492,15 +497,16 @@ public readonly ref readonly T Current
492497 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
493498 internal Enumerator ( T [ ] array )
494499 {
495- _array = array ;
496500 _index = - 1 ;
501+ _array = array ;
497502 }
498503
499504 /// <summary>
500505 /// Advances the enumerator to the next element of the collection.
501506 /// </summary>
502507 /// <returns>
503- /// <see langword="true"/> if the enumerator was successfully advanced to the next element; otherwise, <see langword="false"/>.
508+ /// <see langword="true"/> if the enumerator was successfully advanced to the next element;
509+ /// otherwise, <see langword="false"/>.
504510 /// </returns>
505511 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
506512 public bool MoveNext ( ) =>
0 commit comments