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:
Lioncash
2019-06-07 17:26:22 -04:00
parent 747128b093
commit a3ed4ceec5
3 changed files with 15 additions and 14 deletions

View File

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