diff -r b72c6db6890b -r 5dc02b23752f src/corelib/tools/qhash.h --- a/src/corelib/tools/qhash.h Wed Jun 23 19:07:03 2010 +0300 +++ b/src/corelib/tools/qhash.h Tue Jul 06 15:10:48 2010 +0300 @@ -299,6 +299,7 @@ inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QHash &other) const { return d == other.d; } void clear(); @@ -624,6 +625,7 @@ Q_OUTOFLINE_TEMPLATE QList QHash::uniqueKeys() const { QList res; + res.reserve(size()); // May be too much, but assume short lifetime const_iterator i = begin(); if (i != end()) { for (;;) { @@ -643,6 +645,7 @@ Q_OUTOFLINE_TEMPLATE QList QHash::keys() const { QList res; + res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.key()); @@ -687,6 +690,7 @@ Q_OUTOFLINE_TEMPLATE QList QHash::values() const { QList res; + res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.value()); @@ -927,7 +931,7 @@ { return QHash::insertMulti(key, value); } inline QMultiHash &operator+=(const QMultiHash &other) - { this->unite(other); return *this; } + { unite(other); return *this; } inline QMultiHash operator+(const QMultiHash &other) const { QMultiHash result = *this; result += other; return result; } @@ -1002,7 +1006,12 @@ typename QHash::iterator end(QHash::end()); while (i != end && i.key() == key) { if (i.value() == value) { - i = this->erase(i); +#if defined(Q_CC_RVCT) + // RVCT has problems with scoping, apparently. + i = QHash::erase(i); +#else + i = erase(i); +#endif ++n; } else { ++i;