This commit is contained in:
Mathew Sutcliffe
2014-05-19 23:10:46 +01:00
parent 1b82536913
commit 8f2c733f47
2 changed files with 6 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ namespace BlackMisc
*/ */
bool CIndexVariantMap::operator !=(const CIndexVariantMap &other) const bool CIndexVariantMap::operator !=(const CIndexVariantMap &other) const
{ {
return !(this->operator ==(other)); return !(*this == other);
} }
/* /*
@@ -133,8 +133,7 @@ namespace BlackMisc
} }
} }
// replace values in one step // replace values in one step
this->m_values.clear(); this->m_values.swap(newMap);
this->m_values.unite(newMap);
} }
/* /*

View File

@@ -112,9 +112,8 @@ namespace BlackMisc
if (indexMap.isEmpty()) return 0; if (indexMap.isEmpty()) return 0;
int c = 0; int c = 0;
QMap<int, QVariant>::const_iterator it; const auto &map = indexMap.map();
const QMap<int, QVariant> &map = indexMap.map(); for (auto it = map.begin(); it != map.end(); ++it)
for (it = map.begin(); it != map.end(); ++it)
{ {
this->setPropertyByIndex(it.value(), it.key()); this->setPropertyByIndex(it.value(), it.key());
} }
@@ -127,9 +126,8 @@ namespace BlackMisc
bool operator==(const CIndexVariantMap &indexMap, const CValueObject &valueObject) bool operator==(const CIndexVariantMap &indexMap, const CValueObject &valueObject)
{ {
if (indexMap.isEmpty()) return indexMap.isWildcard(); if (indexMap.isEmpty()) return indexMap.isWildcard();
QMap<int, QVariant>::const_iterator it; const auto &map = indexMap.map();
const QMap<int, QVariant> &map = indexMap.map(); for (auto it = map.begin(); it != map.end(); ++it)
for (it = map.begin(); it != map.end(); ++it)
{ {
// QVariant cannot be compared directly // QVariant cannot be compared directly
QVariant p = valueObject.propertyByIndex(it.key()); // from value object QVariant p = valueObject.propertyByIndex(it.key()); // from value object