mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-02 16:32:55 +00:00
Device: Provide operator!= counterparts to operator== for DeviceQualifier
Makes comparison logic symmetric
This commit is contained in:
parent
4b53093acb
commit
5862d1fc41
2 changed files with 15 additions and 1 deletions
|
@ -120,11 +120,21 @@ bool DeviceQualifier::operator==(const Device* const dev) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool DeviceQualifier::operator!=(const Device* const dev) const
|
||||
{
|
||||
return !operator==(dev);
|
||||
}
|
||||
|
||||
bool DeviceQualifier::operator==(const DeviceQualifier& devq) const
|
||||
{
|
||||
return std::tie(cid, name, source) == std::tie(devq.cid, devq.name, devq.source);
|
||||
}
|
||||
|
||||
bool DeviceQualifier::operator!=(const DeviceQualifier& devq) const
|
||||
{
|
||||
return !operator==(devq);
|
||||
}
|
||||
|
||||
std::shared_ptr<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue