improve GameDataCategory lookup time

by changing it to something backed by a HashMap with
 the id as key things can be found without looping over every element.
 This reduced the startup time on my machine to about half of the original time
This commit is contained in:
OMGeeky
2025-08-31 19:18:30 +02:00
parent 297bff84db
commit 703b723322
9 changed files with 147 additions and 103 deletions

View File

@@ -163,7 +163,7 @@ public class SaveItemsWizard extends JDialog {
@Override
public void actionPerformed(ActionEvent e) {
Map<GameDataCategory<JSONElement>, Set<File>> jsonToSave = new IdentityHashMap<GameDataCategory<JSONElement>, Set<File>>();
Map<GameDataCategory<JSONElement>, Set<File>> jsonToSave = new IdentityHashMap<>();
for (SaveEvent event : movedToCreatedList) {
if (event.target instanceof JSONElement) {
if (!jsonToSave.containsKey(event.target.getParent())) {