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:
parent
6099e96d9e
commit
2baa7eb260
@ -499,14 +499,12 @@ void QRollEffect::scroll()
|
|||||||
+ (2 * totalWidth * (elapsed%duration) + duration)
|
+ (2 * totalWidth * (elapsed%duration) + duration)
|
||||||
/ (2 * duration);
|
/ (2 * duration);
|
||||||
// equiv. to int((totalWidth*elapsed) / duration + 0.5)
|
// equiv. to int((totalWidth*elapsed) / duration + 0.5)
|
||||||
done = (currentWidth >= totalWidth);
|
|
||||||
}
|
}
|
||||||
if (currentHeight != totalHeight) {
|
if (currentHeight != totalHeight) {
|
||||||
currentHeight = totalHeight * (elapsed/duration)
|
currentHeight = totalHeight * (elapsed/duration)
|
||||||
+ (2 * totalHeight * (elapsed%duration) + duration)
|
+ (2 * totalHeight * (elapsed%duration) + duration)
|
||||||
/ (2 * duration);
|
/ (2 * duration);
|
||||||
// equiv. to int((totalHeight*elapsed) / duration + 0.5)
|
// equiv. to int((totalHeight*elapsed) / duration + 0.5)
|
||||||
done = (currentHeight >= totalHeight);
|
|
||||||
}
|
}
|
||||||
done = (currentHeight >= totalHeight) &&
|
done = (currentHeight >= totalHeight) &&
|
||||||
(currentWidth >= totalWidth);
|
(currentWidth >= totalWidth);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user