From 67bb730beb4a120febc07e0fada398fc01e2e7b5 Mon Sep 17 00:00:00 2001 From: Wang Yu Date: Thu, 4 Mar 2021 10:54:50 +0800 Subject: QContiguousCache: Remove redundant condition The reverse condition was already checked three lines before. Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7 Reviewed-by: Thiago Macieira (cherry picked from commit 852b070529d2721d2d4e1e7ec1c90d8fe536b088) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/tools/qcontiguouscache.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/corelib') 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::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); -- cgit v1.2.3