From 0eafbdd480440e413f2fd9cdf4f19354be2a0bdb Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 22 Feb 2010 14:44:20 +0100 Subject: do not protect against self-assignment in QList::replace() it's not the task of the container class to do so. Reviewed-by: joao --- src/corelib/tools/qlist.h | 7 +------ 1 file changed, 1 insertion(+), 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::replace(int i, const T &t) { Q_ASSERT_X(i >= 0 && i < p.size(), "QList::replace", "index out of range"); detach(); - if (QTypeInfo::isLarge || QTypeInfo::isStatic) { - reinterpret_cast(p.at(i))->t() = t; - } else { - const T cpy(t); - reinterpret_cast(p.at(i))->t() = cpy; - } + reinterpret_cast(p.at(i))->t() = t; } template -- cgit v0.12