diff options
Diffstat (limited to 'src/emu/mconfig.cpp')
-rw-r--r-- | src/emu/mconfig.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp index c2a09ec8df7..fb97c3138a3 100644 --- a/src/emu/mconfig.cpp +++ b/src/emu/mconfig.cpp @@ -143,7 +143,7 @@ device_execute_interface *machine_config::perfect_quantum_device() const if (!m_perfect_quantum_device.first) return nullptr; - device_t *const found(m_perfect_quantum_device.first->subdevice(m_perfect_quantum_device.second.c_str())); + device_t *const found(m_perfect_quantum_device.first->subdevice(m_perfect_quantum_device.second)); if (!found) { throw emu_fatalerror( @@ -239,7 +239,7 @@ device_t *machine_config::device_remove(const char *tag) remove_references(*device); // let the device's owner do the work - owner->subdevices().m_list.remove(*device); + owner->subdevices().remove(*device); } return nullptr; } @@ -264,12 +264,11 @@ std::pair<const char *, device_t *> machine_config::resolve_owner(const char *ta } // go down the path until we're done with it - std::string part; while (strchr(tag, ':')) { const char *next = strchr(tag, ':'); assert(next != tag); - part.assign(tag, next - tag); + std::string_view part(tag, next - tag); owner = owner->subdevices().find(part); if (!owner) throw emu_fatalerror("Could not find %s when looking up path for device %s\n", part, orig_tag); @@ -314,7 +313,7 @@ device_t &machine_config::add_device(std::unique_ptr<device_t> &&device, device_ if (owner) { // allocate the new device and append it to the owner's list - device_t &result(owner->subdevices().m_list.append(*device.release())); + device_t &result(owner->subdevices().append(std::move(device))); result.add_machine_configuration(*this); return result; } @@ -338,8 +337,8 @@ device_t &machine_config::replace_device(std::unique_ptr<device_t> &&device, dev { current_device_stack const context(*this); device_t &result(existing - ? owner.subdevices().m_list.replace_and_remove(*device.release(), *existing) - : owner.subdevices().m_list.append(*device.release())); + ? owner.subdevices().replace_and_remove(std::move(device), *existing) + : owner.subdevices().append(std::move(device))); result.add_machine_configuration(*this); return result; } @@ -378,10 +377,6 @@ void machine_config::remove_references(device_t &device) else ++it; } - - // iterate over all devices and remove any references - for (device_t &scan : device_enumerator(root_device())) - scan.subdevices().m_tagmap.clear(); } |