Skip to content

Commit b07420a

Browse files
committed
Use EmptyResults to improve code quality
1 parent 9be8b71 commit b07420a

File tree

1 file changed

+3
-2
lines changed
  • Plugins/Flow.Launcher.Plugin.Calculator

1 file changed

+3
-2
lines changed

Plugins/Flow.Launcher.Plugin.Calculator/Main.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class Main : IPlugin, IPluginI18n, ISettingProvider
2222
private const string Comma = ",";
2323
private const string Dot = ".";
2424
private const string IcoPath = "Images/calculator.png";
25+
private static readonly List<Result> EmptyResults = [];
2526

2627
internal static PluginInitContext Context { get; set; } = null!;
2728

@@ -47,7 +48,7 @@ public List<Result> Query(Query query)
4748
{
4849
if (string.IsNullOrWhiteSpace(query.Search))
4950
{
50-
return new List<Result>();
51+
return EmptyResults;
5152
}
5253

5354
try
@@ -138,7 +139,7 @@ public List<Result> Query(Query query)
138139
};
139140
}
140141

141-
return new List<Result>();
142+
return EmptyResults;
142143
}
143144

144145
private static string PowMatchEvaluator(Match m)

0 commit comments

Comments
 (0)