Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 782585e

Browse files
Anipikjkotas
authored andcommitted
Correcting documentation for span and memory slice (#24612)
1 parent ecb3b1b commit 782585e

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/System.Private.CoreLib/shared/System/Memory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ internal Memory(T[]? array, int start)
9292
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
9393
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
9494
/// <exception cref="System.ArgumentOutOfRangeException">
95-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=Length).
95+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;Length).
9696
/// </exception>
9797
[MethodImpl(MethodImplOptions.AggressiveInlining)]
9898
public Memory(T[]? array, int start, int length)
@@ -243,7 +243,7 @@ public override string ToString()
243243
/// </summary>
244244
/// <param name="start">The index at which to begin this slice.</param>
245245
/// <exception cref="System.ArgumentOutOfRangeException">
246-
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;=Length).
246+
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;Length).
247247
/// </exception>
248248
[MethodImpl(MethodImplOptions.AggressiveInlining)]
249249
public Memory<T> Slice(int start)
@@ -263,7 +263,7 @@ public Memory<T> Slice(int start)
263263
/// <param name="start">The index at which to begin this slice.</param>
264264
/// <param name="length">The desired length for the slice (exclusive).</param>
265265
/// <exception cref="System.ArgumentOutOfRangeException">
266-
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;=Length).
266+
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;Length).
267267
/// </exception>
268268
[MethodImpl(MethodImplOptions.AggressiveInlining)]
269269
public Memory<T> Slice(int start, int length)

src/System.Private.CoreLib/shared/System/MemoryExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ public static Span<T> AsSpan<T>(this T[]? array)
996996
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
997997
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
998998
/// <exception cref="System.ArgumentOutOfRangeException">
999-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=Length).
999+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;Length).
10001000
/// </exception>
10011001
[MethodImpl(MethodImplOptions.AggressiveInlining)]
10021002
public static Span<T> AsSpan<T>(this T[]? array, int start, int length)
@@ -1022,7 +1022,7 @@ public static Span<T> AsSpan<T>(this ArraySegment<T> segment)
10221022
/// <remarks>Returns default when <paramref name="segment"/> is null.</remarks>
10231023
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="segment"/> is covariant and array's type is not exactly T[].</exception>
10241024
/// <exception cref="System.ArgumentOutOfRangeException">
1025-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=segment.Count).
1025+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;segment.Count).
10261026
/// </exception>
10271027
[MethodImpl(MethodImplOptions.AggressiveInlining)]
10281028
public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start)
@@ -1056,7 +1056,7 @@ public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Index startIndex)
10561056
/// <remarks>Returns default when <paramref name="segment"/> is null.</remarks>
10571057
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="segment"/> is covariant and array's type is not exactly T[].</exception>
10581058
/// <exception cref="System.ArgumentOutOfRangeException">
1059-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=segment.Count).
1059+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;segment.Count).
10601060
/// </exception>
10611061
[MethodImpl(MethodImplOptions.AggressiveInlining)]
10621062
public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length)
@@ -1095,7 +1095,7 @@ public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Range range)
10951095
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
10961096
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
10971097
/// <exception cref="System.ArgumentOutOfRangeException">
1098-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=array.Length).
1098+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;array.Length).
10991099
/// </exception>
11001100
public static Memory<T> AsMemory<T>(this T[]? array, int start) => new Memory<T>(array, start);
11011101

@@ -1127,7 +1127,7 @@ public static Memory<T> AsMemory<T>(this T[]? array, Index startIndex)
11271127
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
11281128
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
11291129
/// <exception cref="System.ArgumentOutOfRangeException">
1130-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=Length).
1130+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;Length).
11311131
/// </exception>
11321132
public static Memory<T> AsMemory<T>(this T[]? array, int start, int length) => new Memory<T>(array, start, length);
11331133

@@ -1165,7 +1165,7 @@ public static Memory<T> AsMemory<T>(this T[]? array, Range range)
11651165
/// <remarks>Returns default when <paramref name="segment"/> is null.</remarks>
11661166
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="segment"/> is covariant and array's type is not exactly T[].</exception>
11671167
/// <exception cref="System.ArgumentOutOfRangeException">
1168-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=segment.Count).
1168+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;segment.Count).
11691169
/// </exception>
11701170
public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start)
11711171
{
@@ -1185,7 +1185,7 @@ public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start)
11851185
/// <remarks>Returns default when <paramref name="segment"/> is null.</remarks>
11861186
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="segment"/> is covariant and array's type is not exactly T[].</exception>
11871187
/// <exception cref="System.ArgumentOutOfRangeException">
1188-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=segment.Count).
1188+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;segment.Count).
11891189
/// </exception>
11901190
public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start, int length)
11911191
{

src/System.Private.CoreLib/shared/System/ReadOnlyMemory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public ReadOnlyMemory(T[]? array)
7272
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
7373
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
7474
/// <exception cref="System.ArgumentOutOfRangeException">
75-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=Length).
75+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;Length).
7676
/// </exception>
7777
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7878
public ReadOnlyMemory(T[]? array, int start, int length)
@@ -172,7 +172,7 @@ public override string ToString()
172172
/// </summary>
173173
/// <param name="start">The index at which to begin this slice.</param>
174174
/// <exception cref="System.ArgumentOutOfRangeException">
175-
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;=Length).
175+
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;Length).
176176
/// </exception>
177177
[MethodImpl(MethodImplOptions.AggressiveInlining)]
178178
public ReadOnlyMemory<T> Slice(int start)
@@ -192,7 +192,7 @@ public ReadOnlyMemory<T> Slice(int start)
192192
/// <param name="start">The index at which to begin this slice.</param>
193193
/// <param name="length">The desired length for the slice (exclusive).</param>
194194
/// <exception cref="System.ArgumentOutOfRangeException">
195-
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;=Length).
195+
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;Length).
196196
/// </exception>
197197
[MethodImpl(MethodImplOptions.AggressiveInlining)]
198198
public ReadOnlyMemory<T> Slice(int start, int length)

src/System.Private.CoreLib/shared/System/ReadOnlySpan.Fast.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ReadOnlySpan(T[]? array)
6262
/// <param name="length">The number of items in the read-only span.</param>
6363
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
6464
/// <exception cref="System.ArgumentOutOfRangeException">
65-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=Length).
65+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;Length).
6666
/// </exception>
6767
[MethodImpl(MethodImplOptions.AggressiveInlining)]
6868
public ReadOnlySpan(T[]? array, int start, int length)
@@ -246,7 +246,7 @@ public override string ToString()
246246
/// </summary>
247247
/// <param name="start">The index at which to begin this slice.</param>
248248
/// <exception cref="System.ArgumentOutOfRangeException">
249-
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;=Length).
249+
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;Length).
250250
/// </exception>
251251
[MethodImpl(MethodImplOptions.AggressiveInlining)]
252252
public ReadOnlySpan<T> Slice(int start)
@@ -263,7 +263,7 @@ public ReadOnlySpan<T> Slice(int start)
263263
/// <param name="start">The index at which to begin this slice.</param>
264264
/// <param name="length">The desired length for the slice (exclusive).</param>
265265
/// <exception cref="System.ArgumentOutOfRangeException">
266-
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;=Length).
266+
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;Length).
267267
/// </exception>
268268
[MethodImpl(MethodImplOptions.AggressiveInlining)]
269269
public ReadOnlySpan<T> Slice(int start, int length)

src/System.Private.CoreLib/shared/System/Span.Fast.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Span(T[]? array)
6666
/// <remarks>Returns default when <paramref name="array"/> is null.</remarks>
6767
/// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception>
6868
/// <exception cref="System.ArgumentOutOfRangeException">
69-
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;=Length).
69+
/// Thrown when the specified <paramref name="start"/> or end index is not in the range (&lt;0 or &gt;Length).
7070
/// </exception>
7171
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7272
public Span(T[]? array, int start, int length)
@@ -325,7 +325,7 @@ public override string ToString()
325325
/// </summary>
326326
/// <param name="start">The index at which to begin this slice.</param>
327327
/// <exception cref="System.ArgumentOutOfRangeException">
328-
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;=Length).
328+
/// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;Length).
329329
/// </exception>
330330
[MethodImpl(MethodImplOptions.AggressiveInlining)]
331331
public Span<T> Slice(int start)
@@ -342,7 +342,7 @@ public Span<T> Slice(int start)
342342
/// <param name="start">The index at which to begin this slice.</param>
343343
/// <param name="length">The desired length for the slice (exclusive).</param>
344344
/// <exception cref="System.ArgumentOutOfRangeException">
345-
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;=Length).
345+
/// Thrown when the specified <paramref name="start"/> or end index is not in range (&lt;0 or &gt;Length).
346346
/// </exception>
347347
[MethodImpl(MethodImplOptions.AggressiveInlining)]
348348
public Span<T> Slice(int start, int length)

0 commit comments

Comments
 (0)