diff options
author | Mary <mary@mary.zone> | 2022-06-24 19:04:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 19:04:57 +0200 |
commit | 30ee70a9bc9529772198a51b1b9a605932d2ea96 (patch) | |
tree | 93073c3338d139189685fc292c5fd1ad147a2c86 /Ryujinx.HLE/Utilities/StringUtils.cs | |
parent | 232b1012b0c981830ac46bd5024dcc0e35075301 (diff) |
time: Make TimeZoneRule blittable and avoid copies (#3361)1.1.156
* time: Make TimeZoneRule blittable and avoid copies
This drastically reduce overhead of using TimeZoneRule around the
codebase.
Effect on games is unknown
* Add missing Box type
* Ensure we clean the structure still
This doesn't perform any copies
* Address gdkchan's comments
* Simplify Box
Diffstat (limited to 'Ryujinx.HLE/Utilities/StringUtils.cs')
-rw-r--r-- | Ryujinx.HLE/Utilities/StringUtils.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Ryujinx.HLE/Utilities/StringUtils.cs b/Ryujinx.HLE/Utilities/StringUtils.cs index 3027139b..269f9b55 100644 --- a/Ryujinx.HLE/Utilities/StringUtils.cs +++ b/Ryujinx.HLE/Utilities/StringUtils.cs @@ -128,7 +128,7 @@ namespace Ryujinx.HLE.Utilities } } - public static int CompareCStr(ReadOnlySpan<char> s1, ReadOnlySpan<char> s2) + public static int CompareCStr(ReadOnlySpan<byte> s1, ReadOnlySpan<byte> s2) { int s1Index = 0; int s2Index = 0; @@ -142,11 +142,11 @@ namespace Ryujinx.HLE.Utilities return s2[s2Index] - s1[s1Index]; } - public static int LengthCstr(ReadOnlySpan<char> s) + public static int LengthCstr(ReadOnlySpan<byte> s) { int i = 0; - while (s[i] != '\0') + while (s[i] != 0) { i++; } |