summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/device.cpp')
-rw-r--r--src/emu/device.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/emu/device.cpp b/src/emu/device.cpp
index 4eaf9b2b0ee..0192ae9faa2 100644
--- a/src/emu/device.cpp
+++ b/src/emu/device.cpp
@@ -82,7 +82,7 @@ emu::detail::device_registrar const registered_device_types;
// from the provided config
//-------------------------------------------------
-device_t::device_t(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
+device_t::device_t(const machine_config &mconfig, device_type type, std::string_view tag, device_t *owner, u32 clock)
: m_type(type)
, m_owner(owner)
, m_next(nullptr)
@@ -106,10 +106,19 @@ device_t::device_t(const machine_config &mconfig, device_type type, const char *
, m_started(false)
, m_auto_finder_list(nullptr)
{
- if (owner != nullptr)
- m_tag.assign((owner->owner() == nullptr) ? "" : owner->tag()).append(":").append(tag);
+ if (owner)
+ {
+ if (owner->owner())
+ m_tag = owner->tag();
+ else
+ m_tag.clear();
+ m_tag += ":";
+ m_tag += tag;
+ }
else
- m_tag.assign(":");
+ {
+ m_tag = ":";
+ }
set_clock(clock);
}