mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Perf Impro to Deck Editor Loading Issue #1847
This is another extra improvement which avoids setting up card catalog in current editor whenever it is actually **not** needed. To do so, ItemPool now implements and equal method, which reflects to equality of contained items. This is because card pool is set up multiple times whenever the Deck Editor tab is initialised - and the operation of setting up the catalog manager is particularly expensive (let alone useless when it's already done!) Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
This commit is contained in:
@@ -396,7 +396,9 @@ public final class CEditorConstructed extends CDeckEditor<Deck> {
|
||||
public void resetTables() {
|
||||
// Constructed mode can use all cards, no limitations.
|
||||
this.sectionMode = DeckSection.Main;
|
||||
this.getCatalogManager().setPool(normalPool, true);
|
||||
ItemPool currentPool = this.getCatalogManager().getPool();
|
||||
if (currentPool == null || !currentPool.equals(normalPool))
|
||||
this.getCatalogManager().setPool(normalPool, true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getMain());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user