Proper removing search results on SWF close

This commit is contained in:
Jindra Petřík
2021-02-23 22:50:48 +01:00
parent 43baf9d178
commit d6cf6a2c8b
9 changed files with 70 additions and 28 deletions

View File

@@ -139,7 +139,16 @@ public class SearchResultsStorage {
@SuppressWarnings("unchecked")
public List<ScriptSearchResult> getSearchResultsAt(Set<SWF> allSwfs, int index) {
if (unpackedData.containsKey(index)) {
return unpackedData.get(index);
List<ScriptSearchResult> unpacked = unpackedData.get(index);
List<ScriptSearchResult> res = new ArrayList<>();
for (ScriptSearchResult sr : unpacked) {
if (allSwfs.contains(sr.getSWF())) {
res.add(sr);
}
}
return res;
}
List<ScriptSearchResult> result = new ArrayList<>();