diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-22 14:44:20 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-22 18:12:16 +0100 |
commit | 0eafbdd480440e413f2fd9cdf4f19354be2a0bdb (patch) | |
tree | 1eef44ec3d7117e93533e4d3801bb15a42056542 /src/corelib/tools/qlist.h | |
parent | e38f2b026a00acafab96b1fcc7c27a4446ec49d1 (diff) |
do not protect against self-assignment in QList::replace()
it's not the task of the container class to do so.
Reviewed-by: joao
Diffstat (limited to 'src/corelib/tools/qlist.h')
-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 fdebd7d740..1e0cb76f3b 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> |