* Fix violation in System.Private.Xml
- Prefer 'AsSpan' over 'Substring' when span-based overloads are available.
* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifier.cs
Apply suggested optimization.
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
{
if (separator >= 0)
{
- sb.Append(originalIdentifier.Substring(separator, 1));
+ sb.Append(originalIdentifier[separator]);
}
separator++;
separator += names[i].Length;