OSDN Git Service

remove redundant check in QEasingCurve::setType()
authorIvailo Monev <xakepa10@gmail.com>
Thu, 24 Nov 2022 21:56:00 +0000 (23:56 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Thu, 24 Nov 2022 21:56:00 +0000 (23:56 +0200)
since QEasingCurve instances are no longer shared and no detaching is done
the check that was optimization to avoid detaching is no longer worth it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qeasingcurve.cpp

index 8c61336..1b7f129 100644 (file)
@@ -281,7 +281,7 @@ QEasingCurve::QEasingCurve(Type type)
 
 /*!
     Construct a copy of \a other.
- */
+*/
 QEasingCurve::QEasingCurve(const QEasingCurve &other)
     : d_ptr(new QEasingCurvePrivate(*other.d_ptr))
 {
@@ -361,7 +361,7 @@ void QEasingCurve::setAmplitude(qreal amplitude)
     Returns the period. This is not applicable for all curve types.
     It is only applicable if type() is QEasingCurve::InElastic, QEasingCurve::OutElastic,
     QEasingCurve::InOutElastic or QEasingCurve::OutInElastic.
- */
+*/
 qreal QEasingCurve::period() const
 {
     return d_ptr->per;
@@ -414,8 +414,6 @@ QEasingCurve::Type QEasingCurve::type() const
 */
 void QEasingCurve::setType(Type type)
 {
-    if (d_ptr->type == type)
-        return;
     if (Q_UNLIKELY(type < Linear || type >= QEasingCurve::NCurveTypes - 1)) {
         qWarning("QEasingCurve: Invalid curve type %d", type);
         return;