Refactor to use HashSet for document path management

This commit is contained in:
Thorsten Sommer 2025-10-28 08:13:56 +01:00
parent a7ebc117c5
commit a88382dc95
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 4 additions and 4 deletions

View File

@ -137,7 +137,7 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<SettingsDialo
private string policyAnalysisRules = string.Empty;
private string policyOutputRules = string.Empty;
private string deferredContent = string.Empty;
private List<string> loadedDocumentPaths = [];
private HashSet<string> loadedDocumentPaths = [];
private bool IsNoPolicySelectedOrProtected => this.selectedPolicy is null || this.selectedPolicy.IsProtected;

View File

@ -8,13 +8,13 @@ namespace AIStudio.Components;
public partial class AttachDocuments : MSGComponentBase
{
[Parameter]
public List<string> DocumentPaths { get; set; } = [];
public HashSet<string> DocumentPaths { get; set; } = [];
[Parameter]
public EventCallback<List<string>> DocumentPathsChanged { get; set; }
public EventCallback<HashSet<string>> DocumentPathsChanged { get; set; }
[Parameter]
public Func<List<string>, Task> OnChange { get; set; } = _ => Task.CompletedTask;
public Func<HashSet<string>, Task> OnChange { get; set; } = _ => Task.CompletedTask;
[Inject]
private RustService RustService { get; init; } = null!;