From 845c331cac40301da43d107ae547c2818faaff29 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 1 May 2025 13:16:16 +0800 Subject: [PATCH] Remove the bag from dictionary if the bag is empty --- Flow.Launcher/Storage/TopMostRecord.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Flow.Launcher/Storage/TopMostRecord.cs b/Flow.Launcher/Storage/TopMostRecord.cs index f7459dc40..aaf7194e7 100644 --- a/Flow.Launcher/Storage/TopMostRecord.cs +++ b/Flow.Launcher/Storage/TopMostRecord.cs @@ -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)