mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
DSP/LabelMap: Use std::optional with GetLabelValue()
Rather than use a bool and out parameter, we can collapse them into one by using a std::optional.
This commit is contained in:
@ -200,9 +200,9 @@ s32 DSPAssembler::ParseValue(const char* str)
|
||||
else // Everything else is a label.
|
||||
{
|
||||
// Lookup label
|
||||
u16 value;
|
||||
if (m_labels.GetLabelValue(ptr, &value))
|
||||
return value;
|
||||
if (const std::optional<u16> value = m_labels.GetLabelValue(ptr))
|
||||
return *value;
|
||||
|
||||
if (m_cur_pass == 2)
|
||||
ShowError(AssemblerError::UnknownLabel, str);
|
||||
}
|
||||
|
Reference in New Issue
Block a user