Use 'AsSpan' over 'Substring' in 'System.Private.Xml' (#48277)
authorNewell Clark <newellofthefuture@gmail.com>
Mon, 15 Feb 2021 03:47:28 +0000 (22:47 -0500)
committerGitHub <noreply@github.com>
Mon, 15 Feb 2021 03:47:28 +0000 (22:47 -0500)
commit5c2b21bb3f0bbf12daf36b252dab97f57fa40f9a
treec363ea21d16456b1da256ba5aa5dc1eb146d3aad
parenta62ca2d4e65db219ff2fa29d927613b133d466d8
Use 'AsSpan' over 'Substring' in 'System.Private.Xml' (#48277)

* 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>
src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifier.cs