From 644b497df17bae1790c31e23b04f20ff368d4e9e Mon Sep 17 00:00:00 2001 From: Berkan Diler <b.diler@gmx.de> Date: Tue, 22 Feb 2022 14:32:10 +0100 Subject: Collapse AsSpan().Slice(..) calls into AsSpan(..) (#3145) * Collapse AsSpan().Slice(..) calls into AsSpan(..) Less code and a bit faster * Collapse an Array.Clear(array, 0, array.Length) call to Array.Clear(array) --- Ryujinx.HLE/Loaders/Executables/KipExecutable.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Ryujinx.HLE/Loaders/Executables/KipExecutable.cs') diff --git a/Ryujinx.HLE/Loaders/Executables/KipExecutable.cs b/Ryujinx.HLE/Loaders/Executables/KipExecutable.cs index be5b61a2..2073a7e2 100644 --- a/Ryujinx.HLE/Loaders/Executables/KipExecutable.cs +++ b/Ryujinx.HLE/Loaders/Executables/KipExecutable.cs @@ -8,9 +8,9 @@ namespace Ryujinx.HLE.Loaders.Executables class KipExecutable : IExecutable { public byte[] Program { get; } - public Span<byte> Text => Program.AsSpan().Slice((int)TextOffset, (int)TextSize); - public Span<byte> Ro => Program.AsSpan().Slice((int)RoOffset, (int)RoSize); - public Span<byte> Data => Program.AsSpan().Slice((int)DataOffset, (int)DataSize); + public Span<byte> Text => Program.AsSpan((int)TextOffset, (int)TextSize); + public Span<byte> Ro => Program.AsSpan((int)RoOffset, (int)RoSize); + public Span<byte> Data => Program.AsSpan((int)DataOffset, (int)DataSize); public uint TextOffset { get; } public uint RoOffset { get; } @@ -76,7 +76,7 @@ namespace Ryujinx.HLE.Loaders.Executables { reader.GetSegmentSize(segmentType, out int uncompressedSize).ThrowIfFailure(); - var span = program.AsSpan().Slice((int)offset, uncompressedSize); + var span = program.AsSpan((int)offset, uncompressedSize); reader.ReadSegment(segmentType, span).ThrowIfFailure(); -- cgit v1.2.3-70-g09d2