From 60bd67a8bf995e09f3e3e4b4a73b4d6bcd4a6ea1 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 24 Dec 2018 21:12:43 +1100 Subject: prettier, and fewer copies (nw) --- src/devices/cpu/drcbeut.cpp | 10 ++++------ src/devices/cpu/drcbeut.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/devices/cpu/drcbeut.cpp b/src/devices/cpu/drcbeut.cpp index 99f2a0615ac..bf49969ca06 100644 --- a/src/devices/cpu/drcbeut.cpp +++ b/src/devices/cpu/drcbeut.cpp @@ -491,17 +491,15 @@ void drc_label_list::block_end(drcuml_block &block) // undefined //------------------------------------------------- -drccodeptr drc_label_list::get_codeptr(uml::code_label label, drc_label_fixup_delegate callback, void *param) +drccodeptr drc_label_list::get_codeptr(uml::code_label label, drc_label_fixup_delegate const &callback, void *param) { - label_entry *curlabel = find_or_allocate(label); + label_entry *const curlabel = find_or_allocate(label); // if no code pointer, request an OOB callback - if (curlabel->m_codeptr == nullptr && !callback.isnull()) + if (!curlabel->m_codeptr && !callback.isnull()) { label_fixup *fixup = reinterpret_cast(m_cache.alloc(sizeof(*fixup))); - new (fixup) label_fixup; - fixup->m_callback = callback; - fixup->m_label = curlabel; + new (fixup) label_fixup{ nullptr, curlabel, callback }; m_fixup_list.append(*fixup); m_cache.request_oob_codegen(m_oob_callback_delegate, fixup, param); } diff --git a/src/devices/cpu/drcbeut.h b/src/devices/cpu/drcbeut.h index b18fb008060..7317b0ba30b 100644 --- a/src/devices/cpu/drcbeut.h +++ b/src/devices/cpu/drcbeut.h @@ -130,7 +130,7 @@ public: void block_end(drcuml_block &block); // get/set values - drccodeptr get_codeptr(uml::code_label label, drc_label_fixup_delegate fixup, void *param); + drccodeptr get_codeptr(uml::code_label label, drc_label_fixup_delegate const &fixup, void *param); void set_codeptr(uml::code_label label, drccodeptr codeptr); private: -- cgit v1.2.3