mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 08:52:15 -07:00
don't update the deckhash on load
add a new property to decklists that tracks if the deck needs to update the deckhash only update the deckhash if needed when it is asked for this saves computing the deckhash for every loaded deck as performed by the visual deck selector with impunity the copy constructor also now no longer computes the deck hash again the deck hash is now only computed once, on deck load, as expected, resulting in massive amounts of cpu cycles not being wasted
This commit is contained in:
parent
0a1d0f650f
commit
1b62022f25
2 changed files with 27 additions and 17 deletions
|
|
@ -253,6 +253,7 @@ private:
|
|||
QString name, comments;
|
||||
QPair<QString, QString> bannerCard;
|
||||
QString deckHash;
|
||||
bool deckHashDirty;
|
||||
QString lastLoadedTimestamp;
|
||||
QStringList tags;
|
||||
QMap<QString, SideboardPlan *> sideboardPlans;
|
||||
|
|
@ -363,10 +364,7 @@ public:
|
|||
|
||||
int getSideboardSize() const;
|
||||
|
||||
QString getDeckHash() const
|
||||
{
|
||||
return deckHash;
|
||||
}
|
||||
QString getDeckHash();
|
||||
void updateDeckHash();
|
||||
|
||||
InnerDecklistNode *getRoot() const
|
||||
|
|
@ -399,4 +397,4 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue