prettier, and fewer copies (nw)

This commit is contained in:
Vas Crabb 2018-12-24 21:12:43 +11:00 committed by mooglyguy
parent bf3745ed2d
commit 60bd67a8bf
2 changed files with 5 additions and 7 deletions

View File

@ -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<label_fixup *>(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);
}

View File

@ -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: