Remove the bag from dictionary if the bag is empty

This commit is contained in:
Jack251970 2025-05-01 13:16:16 +08:00
parent af087fb85b
commit 845c331cac

View file

@ -188,6 +188,12 @@ namespace Flow.Launcher.Storage
{
value.TryTake(out recordToRemove);
}
// if the bag is empty, remove the bag from the dictionary
if (value.IsEmpty)
{
records.TryRemove(result.OriginQuery.RawQuery, out _);
}
}
internal void AddOrUpdate(Result result)