refs #104 replaced all remaining hash-based comparisons with the multimethod compare()

This commit is contained in:
Mathew Sutcliffe
2014-02-17 15:39:01 +00:00
parent dd4e2c58f3
commit 2dd72c6d3e
6 changed files with 30 additions and 10 deletions

View File

@@ -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;
}
/*