Fix overloaded equal operator of the NetworkDeviceMonitor

This commit is contained in:
Simon Stürz 2025-11-14 21:42:09 +01:00
parent c6dc910f1a
commit 9ff93f9ecc
2 changed files with 7 additions and 5 deletions

View File

@ -176,12 +176,14 @@ bool NetworkDeviceMonitorImpl::isMyNetworkDeviceInfo(const NetworkDeviceInfo &ne
return myNetworkDevice;
}
bool NetworkDeviceMonitorImpl::operator==(NetworkDeviceMonitorImpl *other) const
bool NetworkDeviceMonitorImpl::operator==(const NetworkDeviceMonitorImpl &other) const
{
return m_macAddress == other->macAddress() && m_hostName == other->hostName() && m_address == other->address();
return m_macAddress == other.macAddress()
&& m_hostName == other.hostName()
&& m_address == other.address();
}
bool NetworkDeviceMonitorImpl::operator!=(NetworkDeviceMonitorImpl *other) const
bool NetworkDeviceMonitorImpl::operator!=(const NetworkDeviceMonitorImpl &other) const
{
return !operator==(other);
}

View File

@ -75,8 +75,8 @@ public:
bool isMyNetworkDeviceInfo(const NetworkDeviceInfo &networkDeviceInfo) const;
bool operator==(NetworkDeviceMonitorImpl *other) const;
bool operator!=(NetworkDeviceMonitorImpl *other) const;
bool operator==(const NetworkDeviceMonitorImpl &other) const;
bool operator!=(const NetworkDeviceMonitorImpl &other) const;
private:
MacAddress m_macAddress;