mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
JitArm64_RegCache: Simplify std::find
using ranges and projections
This commit is contained in:
parent
8b1975ab18
commit
203923b267
@ -88,7 +88,7 @@ u32 Arm64RegCache::GetUnlockedRegisterCount() const
|
||||
|
||||
void Arm64RegCache::LockRegister(ARM64Reg host_reg)
|
||||
{
|
||||
auto reg = std::find(m_host_registers.begin(), m_host_registers.end(), host_reg);
|
||||
auto reg = std::ranges::find(m_host_registers, host_reg, &HostReg::GetReg);
|
||||
ASSERT_MSG(DYNA_REC, reg != m_host_registers.end(),
|
||||
"Don't try locking a register that isn't in the cache. Reg {}",
|
||||
static_cast<int>(host_reg));
|
||||
@ -97,7 +97,7 @@ void Arm64RegCache::LockRegister(ARM64Reg host_reg)
|
||||
|
||||
void Arm64RegCache::UnlockRegister(ARM64Reg host_reg)
|
||||
{
|
||||
auto reg = std::find(m_host_registers.begin(), m_host_registers.end(), host_reg);
|
||||
auto reg = std::ranges::find(m_host_registers, host_reg, &HostReg::GetReg);
|
||||
ASSERT_MSG(DYNA_REC, reg != m_host_registers.end(),
|
||||
"Don't try unlocking a register that isn't in the cache. Reg {}",
|
||||
static_cast<int>(host_reg));
|
||||
|
@ -150,8 +150,6 @@ public:
|
||||
void Unlock() { m_locked = false; }
|
||||
Arm64Gen::ARM64Reg GetReg() const { return m_reg; }
|
||||
|
||||
bool operator==(Arm64Gen::ARM64Reg reg) const { return reg == m_reg; }
|
||||
|
||||
private:
|
||||
Arm64Gen::ARM64Reg m_reg = Arm64Gen::ARM64Reg::INVALID_REG;
|
||||
bool m_locked = false;
|
||||
|
Loading…
Reference in New Issue
Block a user