move the QEasingCurve::Custom case to the switch in QEasingCurve::valueForProgress()

side note: only plasma and KWin set custom QEasingCurve function, both are
not used

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-25 00:26:54 +02:00
parent 41bea107bf
commit 6fe67b22f9

View file

@ -559,10 +559,6 @@ qreal QEasingCurve::valueForProgress(qreal progress) const
{
progress = qBound<qreal>(0, progress, 1);
if (d_ptr->func) {
return d_ptr->func(progress);
}
switch (d_ptr->type) {
case QEasingCurve::Linear: {
return easeNone(progress);
@ -699,7 +695,13 @@ qreal QEasingCurve::valueForProgress(qreal progress) const
case QEasingCurve::OutInBack: {
return easeOutInBack(progress, BOUND_OVERSHOOT(d_ptr->over));
}
default: {
case QEasingCurve::Custom: {
if (Q_LIKELY(d_ptr->func)) {
return d_ptr->func(progress);
}
break;
}
case QEasingCurve::NCurveTypes: {
break;
}
}