Skip to content

Commit 612985a

Browse files
committed
Remove useless assignment to local variable
https://github.com/Tenacom/Louis/security/code-scanning/30
1 parent 5300503 commit 612985a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Louis/IO/ReadOnlyMemoryStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,6 @@ private int EmulateRead(int count)
646646

647647
private void CopyToInternal(Stream destination, int originalPosition)
648648
{
649-
var remaining = _position - originalPosition;
650649
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
651650
// On runtimes that have Stream.Write(ReadOnlySpan<byte>), just use that.
652651
destination.Write(_data.Span[originalPosition.._position]);
@@ -656,6 +655,7 @@ private void CopyToInternal(Stream destination, int originalPosition)
656655
// Fortunately, MemoryMarshal can tell us whether this is the case
657656
// and provide us with a reference to the array and the starting index
658657
// of the ReadOnlyMemory, sparing us the use of ArrayPool for a temporary array.
658+
var remaining = _position - originalPosition;
659659
if (MemoryMarshal.TryGetArray(_data, out var dataArray))
660660
{
661661
// If our data is actually in an array, write directly from that.

0 commit comments

Comments
 (0)