Skip to content

Commit

Permalink
Minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
andreise committed Aug 30, 2023
1 parent d9128b1 commit 3ce0237
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ private void InnerCopyToChecked(
? new ReadOnlySpan<T>(items)
: new ReadOnlySpan<T>(items, 0, length);

var destSpan = new Span<T>(array, arrayIndex, length);
var destSpan = arrayIndex == default && length == array.Length
? new Span<T>(array)
: new Span<T>(array, arrayIndex, length);

sourceSpan.CopyTo(destSpan);
}
Expand Down

0 comments on commit 3ce0237

Please sign in to comment.