summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcontiguouscache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qcontiguouscache.h')
-rw-r--r--src/corelib/tools/qcontiguouscache.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index d830c31891..f0f5ac5dcb 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -358,8 +358,7 @@ void QContiguousCache<T>::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<T>::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);