mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 00:55:09 -07:00
[DeckList] Drop const from zone lookup that creates nodes (#7304)
DecklistNodeTree::getZoneObjFromName creates a new zone node when the name is unknown, so declaring it const was a lie that let a const DecklistNodeTree mutate its tree. It is only called from mutating paths (addCard, readZoneElement), so the const qualifier is removed. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
733deac0bb
commit
f4d5fc181d
2 changed files with 2 additions and 2 deletions
|
|
@ -197,7 +197,7 @@ void DecklistNodeTree::forEachCard(const std::function<void(InnerDecklistNode *,
|
|||
* Top-level zones take precedence, then deck-unique custom zones nested under boards
|
||||
* are resolved. Unknown names create a new top-level zone (legacy behavior).
|
||||
*/
|
||||
InnerDecklistNode *DecklistNodeTree::getZoneObjFromName(const QString &zoneName) const
|
||||
InnerDecklistNode *DecklistNodeTree::getZoneObjFromName(const QString &zoneName)
|
||||
{
|
||||
for (int i = 0; i < root->size(); i++) {
|
||||
auto *node = dynamic_cast<InnerDecklistNode *>(root->at(i));
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public:
|
|||
|
||||
private:
|
||||
// Helpers for traversing the tree
|
||||
InnerDecklistNode *getZoneObjFromName(const QString &zoneName) const;
|
||||
InnerDecklistNode *getZoneObjFromName(const QString &zoneName);
|
||||
InnerDecklistNode *findBoardZone(const QString &boardZoneName) const;
|
||||
InnerDecklistNode *findOrCreateBoardZone(const QString &boardZoneName);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue