Skip to content

Commit

Permalink
Fix violation in System.Private.DataContractSerialization (#48274)
Browse files Browse the repository at this point in the history
- Prefer 'AsSpan' over 'Substring' when span-based overloads are available.
  • Loading branch information
NewellClark authored Feb 15, 2021
1 parent 5c2b21b commit b3d7d67
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ internal static List<int> GetDataContractNameForGenericName(string typeName, Str
if (endIndex < 0)
{
if (localName != null)
localName.Append(typeName.Substring(startIndex));
localName.Append(typeName.AsSpan(startIndex));
nestedParamCounts.Add(0);
break;
}
Expand Down

0 comments on commit b3d7d67

Please sign in to comment.