fix(perf): get span via MemoryOwner<T>.Span
directly instead of MemoryOwner<T>.Memory.Span
This commit is contained in:
parent
055882dfc9
commit
1d1df7ed60
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ namespace Ryujinx.Common.Utilities
|
||||||
|
|
||||||
MemoryOwner<byte> ownedMemory = MemoryOwner<byte>.Rent(checked((int)bytesExpected));
|
MemoryOwner<byte> ownedMemory = MemoryOwner<byte>.Rent(checked((int)bytesExpected));
|
||||||
|
|
||||||
var destSpan = ownedMemory.Memory.Span;
|
var destSpan = ownedMemory.Span;
|
||||||
|
|
||||||
int totalBytesRead = 0;
|
int totalBytesRead = 0;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ namespace Ryujinx.Common.Utilities
|
||||||
MemoryOwner<byte> ownedMemory = MemoryOwner<byte>.Rent(checked((int)input.Length));
|
MemoryOwner<byte> ownedMemory = MemoryOwner<byte>.Rent(checked((int)input.Length));
|
||||||
|
|
||||||
// Discard the return value because we assume reading a MemoryStream always succeeds completely.
|
// Discard the return value because we assume reading a MemoryStream always succeeds completely.
|
||||||
_ = input.Read(ownedMemory.Memory.Span);
|
_ = input.Read(ownedMemory.Span);
|
||||||
|
|
||||||
return ownedMemory;
|
return ownedMemory;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue