mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
Use make_intrusive/make_shared for smart pointer construction.
This commit is contained in:
@@ -21,11 +21,11 @@ template <typename Key, typename Value>
|
||||
IndexMap<Key,Value>& DelayedIndexMaps<Key,Value>::get(const String& name, const vector<Key>& init_with) {
|
||||
intrusive_ptr<DelayedIndexMapsData<Key,Value> >& item = data[name];
|
||||
if (!item) { // no item, make a new one
|
||||
item = intrusive(new DelayedIndexMapsData<Key,Value>);
|
||||
item = make_intrusive<DelayedIndexMapsData<Key,Value>>();
|
||||
item->read_data.init(init_with);
|
||||
} else if (!item->unread_data.empty()) { // not read, read now
|
||||
item->read_data.init(init_with);
|
||||
Reader reader(shared(new wxStringInputStream(item->unread_data)), nullptr, _("delayed data for ") + name);
|
||||
Reader reader(make_shared<wxStringInputStream>(item->unread_data), nullptr, _("delayed data for ") + name);
|
||||
reader.handle_greedy(item->read_data);
|
||||
item->unread_data.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user