From 6c8c72a9efc365383ed81b643bd7f5d5ea6923aa Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 9 Jan 2015 00:39:34 +0100 Subject: [PATCH] QHash: clean up class definition ...by removing redundant '' and 'inline'. Change-Id: I9d81950c6384927633de07de511712f7274a1283 Reviewed-by: Thiago Macieira --- src/corelib/tools/qhash.cpp | 20 ++++++++++---------- src/corelib/tools/qhash.h | 32 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 733c2c7eb2..7696e1cf6d 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1146,7 +1146,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW */ /*! - \fn QHash::QHash(QHash &&other) + \fn QHash::QHash(QHash &&other) Move-constructs a QHash instance, making it point at the same object that \a other was pointing to. @@ -1164,7 +1164,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW compiled in C++11 mode. */ -/*! \fn QHash::QHash(const QHash &other) +/*! \fn QHash::QHash(const QHash &other) Constructs a copy of \a other. @@ -1182,34 +1182,34 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW iterators of this hash become invalid. */ -/*! \fn QHash &QHash::operator=(const QHash &other) +/*! \fn QHash &QHash::operator=(const QHash &other) Assigns \a other to this hash and returns a reference to this hash. */ /*! - \fn QHash &QHash::operator=(QHash &&other) + \fn QHash &QHash::operator=(QHash &&other) Move-assigns \a other to this QHash instance. \since 5.2 */ -/*! \fn void QHash::swap(QHash &other) +/*! \fn void QHash::swap(QHash &other) \since 4.8 Swaps hash \a other with this hash. This operation is very fast and never fails. */ -/*! \fn void QMultiHash::swap(QMultiHash &other) +/*! \fn void QMultiHash::swap(QMultiHash &other) \since 4.8 Swaps hash \a other with this hash. This operation is very fast and never fails. */ -/*! \fn bool QHash::operator==(const QHash &other) const +/*! \fn bool QHash::operator==(const QHash &other) const Returns \c true if \a other is equal to this hash; otherwise returns false. @@ -1222,7 +1222,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW \sa operator!=() */ -/*! \fn bool QHash::operator!=(const QHash &other) const +/*! \fn bool QHash::operator!=(const QHash &other) const Returns \c true if \a other is not equal to this hash; otherwise returns \c false. @@ -1322,7 +1322,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW \internal */ -/*! \fn bool QHash::isSharedWith(const QHash &other) const +/*! \fn bool QHash::isSharedWith(const QHash &other) const \internal */ @@ -1644,7 +1644,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW \sa insert(), values() */ -/*! \fn QHash &QHash::unite(const QHash &other) +/*! \fn QHash &QHash::unite(const QHash &other) Inserts all the items in the \a other hash into this hash. If a key is common to both hashes, the resulting hash will contain the diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 13006095e6..e0387d4644 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -338,19 +338,19 @@ public: insert(it->first, it->second); } #endif - inline QHash(const QHash &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); } - inline ~QHash() { if (!d->ref.deref()) freeData(d); } + QHash(const QHash &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); } + ~QHash() { if (!d->ref.deref()) freeData(d); } - QHash &operator=(const QHash &other); + QHash &operator=(const QHash &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast(&QHashData::shared_null); } - inline QHash &operator=(QHash &&other) Q_DECL_NOTHROW + QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast(&QHashData::shared_null); } + QHash &operator=(QHash &&other) Q_DECL_NOTHROW { qSwap(d, other.d); return *this; } #endif - inline void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); } - bool operator==(const QHash &other) const; - inline bool operator!=(const QHash &other) const { return !(*this == other); } + bool operator==(const QHash &other) const; + bool operator!=(const QHash &other) const { return !(*this == other); } inline int size() const { return d->size; } @@ -365,7 +365,7 @@ public: #if QT_SUPPORTS(UNSHARABLE_CONTAINERS) inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; } #endif - inline bool isSharedWith(const QHash &other) const { return d == other.d; } + bool isSharedWith(const QHash &other) const { return d == other.d; } void clear(); @@ -528,7 +528,7 @@ public: const_iterator constFind(const Key &key) const; iterator insert(const Key &key, const T &value); iterator insertMulti(const Key &key, const T &value); - QHash &unite(const QHash &other); + QHash &unite(const QHash &other); // STL compatibility typedef T mapped_type; @@ -604,9 +604,9 @@ QHash::createNode(uint ah, const Key &akey, const T &avalue, Node **anex } template -Q_INLINE_TEMPLATE QHash &QHash::unite(const QHash &other) +Q_INLINE_TEMPLATE QHash &QHash::unite(const QHash &other) { - QHash copy(other); + QHash copy(other); const_iterator it = copy.constEnd(); while (it != copy.constBegin()) { --it; @@ -624,7 +624,7 @@ Q_OUTOFLINE_TEMPLATE void QHash::freeData(QHashData *x) template Q_INLINE_TEMPLATE void QHash::clear() { - *this = QHash(); + *this = QHash(); } template @@ -637,7 +637,7 @@ Q_OUTOFLINE_TEMPLATE void QHash::detach_helper() } template -Q_INLINE_TEMPLATE QHash &QHash::operator=(const QHash &other) +Q_INLINE_TEMPLATE QHash &QHash::operator=(const QHash &other) { if (d != other.d) { QHashData *o = other.d; @@ -965,7 +965,7 @@ Q_OUTOFLINE_TEMPLATE typename QHash::Node **QHash::findNode(cons } template -Q_OUTOFLINE_TEMPLATE bool QHash::operator==(const QHash &other) const +Q_OUTOFLINE_TEMPLATE bool QHash::operator==(const QHash &other) const { if (size() != other.size()) return false; @@ -1004,7 +1004,7 @@ public: } #endif QMultiHash(const QHash &other) : QHash(other) {} - inline void swap(QMultiHash &other) { QHash::swap(other); } // prevent QMultiHash<->QHash swaps + void swap(QMultiHash &other) { QHash::swap(other); } // prevent QMultiHash<->QHash swaps inline typename QHash::iterator replace(const Key &key, const T &value) { return QHash::insert(key, value); }