Prefer AsSpan to Substring to avoid unnecessary allocation

pull/5493/head
Qstick 2 years ago
parent e8aff90582
commit 4db10e6283

@ -194,7 +194,6 @@ dotnet_diagnostic.CA1819.severity = suggestion
dotnet_diagnostic.CA1822.severity = suggestion
dotnet_diagnostic.CA1823.severity = suggestion
dotnet_diagnostic.CA1824.severity = suggestion
dotnet_diagnostic.CA1846.severity = suggestion
dotnet_diagnostic.CA1847.severity = suggestion
dotnet_diagnostic.CA2000.severity = suggestion
dotnet_diagnostic.CA2002.severity = suggestion

@ -250,7 +250,7 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
}
Index = end + 1;
identifier.Append(Buffer.Substring(start, end - start));
identifier.Append(Buffer.AsSpan(start, end - start));
if (Buffer[Index] != escape)
{

Loading…
Cancel
Save