Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small correction on SpanByte #110

Merged
merged 18 commits into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nanoFramework.CoreLibrary/System/SpanByte.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// Copyright (c) .NET Foundation and Contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
Expand Down Expand Up @@ -112,14 +112,14 @@ public byte this[int index]
/// </exception>
public void CopyTo(SpanByte destination)
{
if (destination.Length < _length - _start)
if (destination.Length < _length)
{
throw new ArgumentException($"Destination too small");
}

for (int i = 0; i < _array.Length; i++)
for (int i = 0; i < _length; i++)
{
destination[i] = _array[i];
destination[i] = _array[_start + i];
}
}

Expand Down