time: Make TimeZoneRule blittable and avoid copies (#3361)
* 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
This commit is contained in:
parent
232b1012b0
commit
30ee70a9bc
10 changed files with 157 additions and 147 deletions
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue