diff options
author | Berkan Diler <berkan.diler1@ingka.ikea.com> | 2022-12-24 18:30:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-24 14:30:39 -0300 |
commit | 37d27c4c99486312d9a282d7fc056c657efe0848 (patch) | |
tree | 51b77d6c112064039ed1eadb279251da6039cbc4 /Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs | |
parent | f906eb06c28880c20160cb4a969e3f6fddb3029b (diff) |
Some minor cleanups and optimizations (#4174)1.1.489
* Replace Array.Clear(x, 0, x.Length) with Array.Clear(x)
* Use DateTime.UnixEpoch field
* Replace SHA256.ComputeHash calls with static SHA256.HashData call
More performant and avoids the need to initialize a SHA256 instance.
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs index 0d1ae27f..a111d5d6 100644 --- a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs @@ -142,14 +142,9 @@ namespace Ryujinx.HLE.HOS.Services.Ro _owner.CpuMemory.Read(nroAddress, nroData); - byte[] nroHash = null; - MemoryStream stream = new MemoryStream(nroData); - using (SHA256 hasher = SHA256.Create()) - { - nroHash = hasher.ComputeHash(stream); - } + byte[] nroHash = SHA256.HashData(stream); if (!IsNroHashPresent(nroHash)) { |