diff --git a/src/blackmisc/indexvariantmap.cpp b/src/blackmisc/indexvariantmap.cpp index 3c7a8433a..52b30c7b3 100644 --- a/src/blackmisc/indexvariantmap.cpp +++ b/src/blackmisc/indexvariantmap.cpp @@ -30,7 +30,7 @@ namespace BlackMisc */ 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 - this->m_values.clear(); - this->m_values.unite(newMap); + this->m_values.swap(newMap); } /* diff --git a/src/blackmisc/valueobject.cpp b/src/blackmisc/valueobject.cpp index 4fc4817cb..66eca7a3a 100644 --- a/src/blackmisc/valueobject.cpp +++ b/src/blackmisc/valueobject.cpp @@ -112,9 +112,8 @@ namespace BlackMisc if (indexMap.isEmpty()) return 0; int c = 0; - QMap::const_iterator it; - const QMap &map = indexMap.map(); - for (it = map.begin(); it != map.end(); ++it) + const auto &map = indexMap.map(); + for (auto it = map.begin(); it != map.end(); ++it) { this->setPropertyByIndex(it.value(), it.key()); } @@ -127,9 +126,8 @@ namespace BlackMisc bool operator==(const CIndexVariantMap &indexMap, const CValueObject &valueObject) { if (indexMap.isEmpty()) return indexMap.isWildcard(); - QMap::const_iterator it; - const QMap &map = indexMap.map(); - for (it = map.begin(); it != map.end(); ++it) + const auto &map = indexMap.map(); + for (auto it = map.begin(); it != map.end(); ++it) { // QVariant cannot be compared directly QVariant p = valueObject.propertyByIndex(it.key()); // from value object