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 <shawn.rutledge@qt.io>
This commit is contained in:
Ivan Tkachenko 2022-01-12 21:24:09 +03:00
parent 6099e96d9e
commit 2baa7eb260

View File

@ -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);