mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #104 replaced all remaining hash-based comparisons with the multimethod compare()
This commit is contained in:
@@ -55,9 +55,13 @@ namespace BlackMisc
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CSettingsNetwork::compareImpl(const CValueObject &/*otherBase*/) const
|
||||
int CSettingsNetwork::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
qFatal("not implemented");
|
||||
const auto &other = static_cast<const CSettingsNetwork &>(otherBase);
|
||||
|
||||
int result;
|
||||
if ((result = compare(this->m_trafficNetworkServerCurrent, other.m_trafficNetworkServerCurrent))) { return result; }
|
||||
if ((result = compare(this->m_trafficNetworkServers, other.m_trafficNetworkServers))) { return result; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,7 +89,7 @@ namespace BlackMisc
|
||||
bool CSettingsNetwork::operator ==(const CSettingsNetwork &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return this->getValueHash() == other.getValueHash();
|
||||
return compare(*this, other) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user