mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Clean up pointer use:
* Use unique_ptr for Actions instead of manual memory management * Use unique_ptr in KeywordDatabase * Use unique_ptr instead of shared_ptr for file formats * Don't pass shared_ptr to Reader/Writer, use references instead Also * Switch to C++17 so we can use map::try_emplace
This commit is contained in:
@@ -140,7 +140,7 @@ DECLARE_DYNAMIC_ARG(KeywordUsageStatistics*, keyword_usage_statistics);
|
||||
* The database should be rebuild.
|
||||
*/
|
||||
class KeywordDatabase {
|
||||
public:
|
||||
public:
|
||||
KeywordDatabase();
|
||||
~KeywordDatabase();
|
||||
|
||||
@@ -165,8 +165,8 @@ class KeywordDatabase {
|
||||
*/
|
||||
String expand(const String& text, const ScriptValueP& match_condition, const ScriptValueP& expand_default, const ScriptValueP& combine_script, Context& ctx) const;
|
||||
|
||||
private:
|
||||
KeywordTrie* root; ///< Data structure for finding keywords
|
||||
private:
|
||||
unique_ptr<KeywordTrie> root; ///< Data structure for finding keywords
|
||||
|
||||
/// (try to) expand a single keyword
|
||||
/** If the keyword matches:
|
||||
|
||||
Reference in New Issue
Block a user