diff options
author | Berkan Diler <b.diler@gmx.de> | 2022-10-19 01:31:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 23:31:34 +0000 |
commit | c40c3905e2836e8b105406430c33659a84c2e3ca (patch) | |
tree | 4a1ed99ae42fc57a0d6288680a319e594729a18d /Ryujinx.HLE/Utilities/StringUtils.cs | |
parent | a6cd044f0f675ee0bd9d3954228bbd3f2f992a22 (diff) |
Avoid allocations in .Parse methods (#3760)1.1.310
* Avoid allocations in .Parse methods
Use the Span overloads of the Parse methods when possible to avoid string allocations and remove one unnecessarry array allocation
* Avoid another string allocation
Diffstat (limited to 'Ryujinx.HLE/Utilities/StringUtils.cs')
-rw-r--r-- | Ryujinx.HLE/Utilities/StringUtils.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.HLE/Utilities/StringUtils.cs b/Ryujinx.HLE/Utilities/StringUtils.cs index 269f9b55..a64d451c 100644 --- a/Ryujinx.HLE/Utilities/StringUtils.cs +++ b/Ryujinx.HLE/Utilities/StringUtils.cs @@ -54,7 +54,7 @@ namespace Ryujinx.HLE.Utilities for (int index = 0; index < bytesInHex; index++) { - output[index] = byte.Parse(hexString.Substring(index * 2, 2), NumberStyles.HexNumber); + output[index] = byte.Parse(hexString.AsSpan(index * 2, 2), NumberStyles.HexNumber); } return output; |