Skip to content

Commit

Permalink
Clarify index parameters (#10830)
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren authored Jan 13, 2025
1 parent aa88d43 commit 04767a2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions xml/System/Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1471,9 +1471,9 @@
</Parameters>
<Docs>
<param name="sourceArray">The <see cref="T:System.Array" /> that contains the data to copy.</param>
<param name="sourceIndex">A 32-bit integer that represents the index in the <paramref name="sourceArray" /> at which copying begins.</param>
<param name="sourceIndex">A 32-bit integer that represents the index in <paramref name="sourceArray" /> at which copying begins.</param>
<param name="destinationArray">The <see cref="T:System.Array" /> that receives the data.</param>
<param name="destinationIndex">A 32-bit integer that represents the index in the <paramref name="destinationArray" /> at which storing begins.</param>
<param name="destinationIndex">A 32-bit integer that represents the index in <paramref name="destinationArray" /> at which storing begins.</param>
<param name="length">A 32-bit integer that represents the number of elements to copy.</param>
<summary>Copies a range of elements from an <see cref="T:System.Array" /> starting at the specified source index and pastes them to another <see cref="T:System.Array" /> starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely.</summary>
<remarks>
Expand All @@ -1490,11 +1490,11 @@

This method is equivalent to the standard C/C++ function `memmove`, not `memcpy`.

The arrays can be reference-type arrays or value-type arrays. If `sourceArray` and `destinationArray` are both reference-type arrays or are both arrays of type <xref:System.Object>, a shallow copy is performed. A shallow copy of an <xref:System.Array> is a new <xref:System.Array> containing references to the same elements as the original <xref:System.Array>. The elements themselves or anything referenced by the elements are not copied. In contrast, a deep copy of an <xref:System.Array> copies the elements and everything directly or indirectly referenced by the elements.
The arrays can be reference-type or value-type arrays. If `sourceArray` and `destinationArray` are both reference-type arrays or are both arrays of type <xref:System.Object>, a shallow copy is performed. A shallow copy of an <xref:System.Array> is a new <xref:System.Array> containing references to the same elements as the original <xref:System.Array>. The elements themselves or anything referenced by the elements are not copied. In contrast, a deep copy of an <xref:System.Array> copies the elements and everything directly or indirectly referenced by the elements.

If this method throws an exception while copying, the `destinationArray` remains unchanged; therefore, <xref:System.Array.ConstrainedCopy%2A> can be used within a constrained execution region (<xref:System.Runtime.ConstrainedExecution.Cer>).

This method is an O(`n`) operation, where `n` is `length`.
This method is an $O(n)$ operation, where $n$ is `length`.

]]></format>
</remarks>
Expand Down Expand Up @@ -1945,9 +1945,9 @@
</Parameters>
<Docs>
<param name="sourceArray">The <see cref="T:System.Array" /> that contains the data to copy.</param>
<param name="sourceIndex">A 32-bit integer that represents the index in the <paramref name="sourceArray" /> at which copying begins.</param>
<param name="sourceIndex">A 32-bit integer that represents the index in <paramref name="sourceArray" /> at which copying begins.</param>
<param name="destinationArray">The <see cref="T:System.Array" /> that receives the data.</param>
<param name="destinationIndex">A 32-bit integer that represents the index in the <paramref name="destinationArray" /> at which storing begins.</param>
<param name="destinationIndex">A 32-bit integer that represents the index in <paramref name="destinationArray" /> at which storing begins.</param>
<param name="length">A 32-bit integer that represents the number of elements to copy.</param>
<summary>Copies a range of elements from an <see cref="T:System.Array" /> starting at the specified source index and pastes them to another <see cref="T:System.Array" /> starting at the specified destination index. The length and the indexes are specified as 32-bit integers.</summary>
<remarks>
Expand Down Expand Up @@ -2072,9 +2072,9 @@
</Parameters>
<Docs>
<param name="sourceArray">The <see cref="T:System.Array" /> that contains the data to copy.</param>
<param name="sourceIndex">A 64-bit integer that represents the index in the <paramref name="sourceArray" /> at which copying begins.</param>
<param name="sourceIndex">A 64-bit integer that represents the index in <paramref name="sourceArray" /> at which copying begins.</param>
<param name="destinationArray">The <see cref="T:System.Array" /> that receives the data.</param>
<param name="destinationIndex">A 64-bit integer that represents the index in the <paramref name="destinationArray" /> at which storing begins.</param>
<param name="destinationIndex">A 64-bit integer that represents the index in <paramref name="destinationArray" /> at which storing begins.</param>
<param name="length">A 64-bit integer that represents the number of elements to copy. The integer must be between zero and <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>, inclusive.</param>
<summary>Copies a range of elements from an <see cref="T:System.Array" /> starting at the specified source index and pastes them to another <see cref="T:System.Array" /> starting at the specified destination index. The length and the indexes are specified as 64-bit integers.</summary>
<remarks>
Expand Down Expand Up @@ -2232,7 +2232,7 @@
</Parameters>
<Docs>
<param name="array">The one-dimensional array that is the destination of the elements copied from the current array.</param>
<param name="index">A 32-bit integer that represents the index in <paramref name="array" /> at which copying begins.</param>
<param name="index">A 32-bit integer that represents the index in the destination array at which copying begins.</param>
<summary>Copies all the elements of the current one-dimensional array to the specified one-dimensional array starting at the specified destination array index. The index is specified as a 32-bit integer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
Expand Down Expand Up @@ -2316,7 +2316,7 @@
</Parameters>
<Docs>
<param name="array">The one-dimensional array that is the destination of the elements copied from the current array.</param>
<param name="index">A 64-bit integer that represents the index in <paramref name="array" /> at which copying begins.</param>
<param name="index">A 64-bit integer that represents the index in the destination array at which copying begins.</param>
<summary>Copies all the elements of the current one-dimensional array to the specified one-dimensional array starting at the specified destination array index. The index is specified as a 64-bit integer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
Expand Down Expand Up @@ -3395,11 +3395,11 @@
</Parameters>
<Docs>
<typeparam name="T">The type of the elements of the array.</typeparam>
<param name="array">The <see cref="T:System.Array" /> to be filled.</param>
<param name="array">The array to be filled.</param>
<param name="value">The new value for the elements in the specified range.</param>
<param name="startIndex">A 32-bit integer that represents the index in the <see cref="T:System.Array" /> at which filling begins.</param>
<param name="startIndex">A 32-bit integer that represents the index in <paramref name="array" /> at which filling begins.</param>
<param name="count">The number of elements to copy.</param>
<summary>Assigns the given <paramref name="value" /> of type <typeparamref name="T" /> to the elements of the specified <paramref name="array" /> which are
<summary>Assigns the given <paramref name="value" /> of type <typeparamref name="T" /> to the elements of the specified <paramref name="array" /> that are
within the range of <paramref name="startIndex" /> (inclusive) and the next <paramref name="count" /> number of indices.</summary>
<remarks>To be added.</remarks>
</Docs>
Expand Down

0 comments on commit 04767a2

Please sign in to comment.