mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Make SearchResult readonly and init HighlightData to empty list
Changed SearchResult to a readonly record struct for better immutability and performance. Updated HighlightData to initialize as an empty list using a collection expression instead of null. Retained the default constructor with a clarifying comment.
This commit is contained in:
parent
10f160d9a2
commit
43d3963e3d
1 changed files with 3 additions and 2 deletions
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
namespace Flow.Launcher.Plugin.Explorer.Search
|
||||
{
|
||||
public record struct SearchResult
|
||||
public readonly record struct SearchResult
|
||||
{
|
||||
// Constructor is necesssary for record struct
|
||||
public SearchResult()
|
||||
{
|
||||
}
|
||||
|
|
@ -13,6 +14,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
public int Score { get; init; }
|
||||
|
||||
public bool WindowsIndexed { get; init; }
|
||||
public List<int> HighlightData { get; init; } = null;
|
||||
public List<int> HighlightData { get; init; } = [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue