From 2baa7eb260085555433d2e22c0b7606b9ee1a02e Mon Sep 17 00:00:00 2001 From: Ivan Tkachenko Date: Wed, 12 Jan 2022 21:24:09 +0300 Subject: [PATCH] QRollEffect: Remove assignments that have no effect Value of the member variable `done` will be overwritten after the end of each `if` block. Pointed out by PVS-Studio static analysis tool: https://habr.com/ru/company/pvs-studio/blog/542760 Change-Id: Icaf965aaebfa8a238dd3569689e1496a30d4b6d1 Reviewed-by: Shawn Rutledge --- src/widgets/widgets/qeffects.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp index 0090f9b0b9e..f5acfe27b86 100644 --- a/src/widgets/widgets/qeffects.cpp +++ b/src/widgets/widgets/qeffects.cpp @@ -499,14 +499,12 @@ void QRollEffect::scroll() + (2 * totalWidth * (elapsed%duration) + duration) / (2 * duration); // equiv. to int((totalWidth*elapsed) / duration + 0.5) - done = (currentWidth >= totalWidth); } if (currentHeight != totalHeight) { currentHeight = totalHeight * (elapsed/duration) + (2 * totalHeight * (elapsed%duration) + duration) / (2 * duration); // equiv. to int((totalHeight*elapsed) / duration + 0.5) - done = (currentHeight >= totalHeight); } done = (currentHeight >= totalHeight) && (currentWidth >= totalWidth);