From 7b737b172d0a1cd23d8edd2d5d00615d64ad3c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 31 May 2012 09:49:26 +0200 Subject: Remove debugging code from QVector It was depending on internals of Q_ASSERT Change-Id: I3dfc0ae0438135a30961f36808dbfc3e663a5538 Reviewed-by: Thiago Macieira --- src/corelib/tools/qvector.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/corelib/tools/qvector.h') diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 5b2cc11ed1..2e98fcedca 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -495,10 +495,7 @@ void QVector::realloc(const int asize, const int aalloc, QArrayData::Allocati Data *x = d; const bool isShared = d->ref.isShared(); -#ifndef QT_NO_DEBUG - bool moved = false; - int oldSize = d->size; -#endif + if (aalloc != 0) { if (aalloc != int(d->alloc) || isShared) { QT_TRY { @@ -526,9 +523,6 @@ void QVector::realloc(const int asize, const int aalloc, QArrayData::Allocati // destruct unused / not moved data if (asize < d->size) destruct(d->begin() + asize, d->end()); -#ifndef QT_NO_DEBUG - moved = true; -#endif } if (asize > d->size) { @@ -563,11 +557,9 @@ void QVector::realloc(const int asize, const int aalloc, QArrayData::Allocati if (d != x) { if (!d->ref.deref()) { Q_ASSERT(!isShared); - Q_ASSERT(d->size == oldSize); if (QTypeInfo::isStatic || !aalloc) { // data was copy constructed, we need to call destructors // or if !alloc we did nothing to the old 'd'. - Q_ASSERT(!moved); free(d); } else { Data::deallocate(d); -- cgit v1.2.3