diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-22 13:44:20 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-22 17:12:16 (GMT) |
commit | 0eafbdd480440e413f2fd9cdf4f19354be2a0bdb (patch) | |
tree | 1eef44ec3d7117e93533e4d3801bb15a42056542 | |
parent | e38f2b026a00acafab96b1fcc7c27a4446ec49d1 (diff) | |
download | Qt-0eafbdd480440e413f2fd9cdf4f19354be2a0bdb.zip Qt-0eafbdd480440e413f2fd9cdf4f19354be2a0bdb.tar.gz Qt-0eafbdd480440e413f2fd9cdf4f19354be2a0bdb.tar.bz2 |
do not protect against self-assignment in QList::replace()
it's not the task of the container class to do so.
Reviewed-by: joao
-rw-r--r-- | src/corelib/tools/qlist.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index fdebd7d..1e0cb76 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -555,12 +555,7 @@ inline void QList<T>::replace(int i, const T &t) { Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>::replace", "index out of range"); detach(); - if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) { - reinterpret_cast<Node *>(p.at(i))->t() = t; - } else { - const T cpy(t); - reinterpret_cast<Node *>(p.at(i))->t() = cpy; - } + reinterpret_cast<Node *>(p.at(i))->t() = t; } template <typename T> |