mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 03:46:42 +01:00
Merge pull request #3940 from lioncash/tie
Device: Use std::tie for operator==
This commit is contained in:
commit
bc354277ca
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
// For InputGateOn()
|
// For InputGateOn()
|
||||||
// This is a really bad layering violation, but it's the cleanest
|
// This is a really bad layering violation, but it's the cleanest
|
||||||
@ -136,12 +137,7 @@ bool DeviceQualifier::operator==(const Device* const dev) const
|
|||||||
|
|
||||||
bool DeviceQualifier::operator==(const DeviceQualifier& devq) const
|
bool DeviceQualifier::operator==(const DeviceQualifier& devq) const
|
||||||
{
|
{
|
||||||
if (cid == devq.cid)
|
return std::tie(cid, name, source) == std::tie(devq.cid, devq.name, devq.source);
|
||||||
if (name == devq.name)
|
|
||||||
if (source == devq.source)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq) const
|
std::shared_ptr<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user