Skip to content

Commit 845c331

Browse files
committed
Remove the bag from dictionary if the bag is empty
1 parent af087fb commit 845c331

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Flow.Launcher/Storage/TopMostRecord.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ internal void Remove(Result result)
188188
{
189189
value.TryTake(out recordToRemove);
190190
}
191+
192+
// if the bag is empty, remove the bag from the dictionary
193+
if (value.IsEmpty)
194+
{
195+
records.TryRemove(result.OriginQuery.RawQuery, out _);
196+
}
191197
}
192198

193199
internal void AddOrUpdate(Result result)

0 commit comments

Comments
 (0)