diff options
author | Wang Yu <wangyu@uniontech.com> | 2021-03-04 10:54:50 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-19 09:28:32 +0000 |
commit | 67bb730beb4a120febc07e0fada398fc01e2e7b5 (patch) | |
tree | 6235fe81f77ae0b6c2f1e1a10eb692481abea73d /src/corelib/tools | |
parent | a441548f421404c324a562ff15a7abc23f4a5ab3 (diff) |
QContiguousCache: Remove redundant condition
The reverse condition was already checked three lines before.
Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 852b070529d2721d2d4e1e7ec1c90d8fe536b088)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qcontiguouscache.h | 4 |
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); |