diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index d830c318913..f0f5ac5dcbe 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -358,8 +358,7 @@ void QContiguousCache::prepend(T &&value) if (d->count != d->alloc) d->count++; else - if (d->count == d->alloc) - (d->array + d->start)->~T(); + (d->array + d->start)->~T(); new (d->array + d->start) T(std::move(value)); } @@ -379,7 +378,6 @@ void QContiguousCache::prepend(const T &value) if (d->count != d->alloc) d->count++; else - if (d->count == d->alloc) (d->array + d->start)->~T(); new (d->array + d->start) T(value);