Avoid some const_casts

This commit is contained in:
Chris Robinson 2022-02-14 00:22:41 -08:00
parent c156e30a48
commit 9e418202fd

View File

@ -43,21 +43,18 @@ void EaxFxSlots::uninitialize() noexcept
}
}
const ALeffectslot& EaxFxSlots::get(
EaxFxSlotIndex index) const
const ALeffectslot& EaxFxSlots::get(EaxFxSlotIndex index) const
{
if (!index.has_value())
{
if(!index.has_value())
fail("Empty index.");
}
return *fx_slots_[index.value()];
}
ALeffectslot& EaxFxSlots::get(
EaxFxSlotIndex index)
ALeffectslot& EaxFxSlots::get(EaxFxSlotIndex index)
{
return const_cast<ALeffectslot&>(const_cast<const EaxFxSlots*>(this)->get(index));
if(!index.has_value())
fail("Empty index.");
return *fx_slots_[index.value()];
}
void EaxFxSlots::unlock_legacy() noexcept