Minor tweaks to Mike's map of maps cache work on stats. Mostly these changes are stylistic changes that favor more terse code, but there was one bug where a double-delete was happening - GameStateDeckViewer used to allocate its own StatsWrapper, and deleted it as part of teardown - now that the allocation is owned by the deck stats instance, it's not allowed to do the deletion anymore.
I'll also note that the mods I did to getDeckMetaDataById() are completely unnecessary - pragmatically speaking, it's doing the same thing. The only difference is that I'm using std::find_if instead of brute iterator manipulation, and I'm using a predicate function. For a simple check like this, it's kind of pointless, but if you need to do more complex comparisons, predicate operators can become quite powerful.
This commit is contained in:
@@ -71,7 +71,6 @@ GameStateDeckViewer::~GameStateDeckViewer()
|
||||
SAFE_DELETE(myCollection->parent);
|
||||
SAFE_DELETE(myCollection);
|
||||
}
|
||||
SAFE_DELETE(stw);
|
||||
SAFE_DELETE(filterMenu);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user