Skip to content

Commit 0c3e9cd

Browse files
committed
Fixed: do not allocate collection (regression from #156)
1 parent d0713c7 commit 0c3e9cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/DiagnosticCollector.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Collections.Immutable;
34
using JetBrains.Annotations;
45
using Microsoft.CodeAnalysis;
56

@@ -22,7 +23,7 @@ public ICollection<Diagnostic> Diagnostics
2223
{
2324
if (diagnostics == null)
2425
{
25-
return [];
26+
return ImmutableArray<Diagnostic>.Empty;
2627
}
2728

2829
return diagnostics;

0 commit comments

Comments
 (0)