summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcontiguouscache.h
diff options
context:
space:
mode:
authorWang Yu <wangyu@uniontech.com>2021-03-04 10:54:50 +0800
committerWang Yu <wangyu@uniontech.com>2021-03-05 07:27:14 +0000
commit852b070529d2721d2d4e1e7ec1c90d8fe536b088 (patch)
treea4ae462dd4fdad07e2d07e6597c417c46298ee9c /src/corelib/tools/qcontiguouscache.h
parent9fb81fc28774cd4aa01a8b29d59150e1a7de8fd8 (diff)
QContiguousCache: Remove redundant condition
The reverse condition was already checked three lines before. Pick-to: 6.1 Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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);