Skip to content

Commit

Permalink
Fixed Insertion test regression
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Oct 25, 2023
1 parent eea805f commit 9d5cefa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DotNext/Buffers/PooledArrayBufferWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,9 @@ private static void CopyFast(T[] source, T[] destination, int length)
Debug.Assert(length <= source.Length);
Debug.Assert(length <= destination.Length);

source.CopyTo(MemoryMarshal.CreateSpan(ref MemoryMarshal.GetArrayDataReference(destination), length));
var src = MemoryMarshal.CreateReadOnlySpan(ref MemoryMarshal.GetArrayDataReference(source), length);
var dest = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetArrayDataReference(destination), length);
src.CopyTo(dest);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 9d5cefa

Please sign in to comment.