提交 09fcd8ba 编写于 作者: P Paul Harrington

Use Array.Empty instead of SpecializedCollection

上级 f0cdefea
......@@ -79,7 +79,7 @@ private static TextChunk[] BreakPatternIntoTextChunks(string pattern, bool verba
if (partCount == 0)
{
return SpecializedCollections.EmptyArray<TextChunk>();
return Array.Empty<TextChunk>();
}
var result = new TextChunk[partCount];
......@@ -169,7 +169,7 @@ public PatternMatcher(string pattern, CultureInfo culture, bool verbatimIdentifi
if (pattern.IndexOf('.') < 0)
{
// PERF: Avoid string.Split allocations when the pattern doesn't contain a dot.
_dotSeparatedSegments = pattern.Length > 0 ? new Segment[1] { _fullPatternSegment } : SpecializedCollections.EmptyArray<Segment>();
_dotSeparatedSegments = pattern.Length > 0 ? new Segment[1] { _fullPatternSegment } : Array.Empty<Segment>();
}
else
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册