Avoid allocations in .Parse methods (#3760)
* 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
This commit is contained in:
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.Loaders.Mods
|
||||
{
|
||||
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
|
||||
{
|
||||
return int.TryParse(str.Substring(2), System.Globalization.NumberStyles.HexNumber, null, out value);
|
||||
return int.TryParse(str.AsSpan(2), System.Globalization.NumberStyles.HexNumber, null, out value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user