From 530fbd2faae9eb0cf97ebf6ebe2ddeefbef8c010 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 7 Jul 2022 16:07:16 +0200 Subject: [PATCH] QFixed: remove user-defined assignment operators They don't give us anything: For every op=(X), there's an implicit QFixed(X) constructor that will resolve any fix = x; as fix = QFixed(x); with no performance penalty. Change-Id: Ia5b0364617a646f3cf122b47363d6099548bb5c2 Reviewed-by: Lars Knoll (cherry picked from commit 9b92f599406aaf218fd2be2f290dc4938049ade1) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qfixed_p.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/painting/qfixed_p.h b/src/gui/painting/qfixed_p.h index da69f901cd0..de52e2e815b 100644 --- a/src/gui/painting/qfixed_p.h +++ b/src/gui/painting/qfixed_p.h @@ -29,8 +29,6 @@ public: constexpr QFixed() : val(0) {} constexpr QFixed(int i) : val(i * 64) {} constexpr QFixed(long i) : val(i * 64) {} - QFixed &operator=(int i) { val = i * 64; return *this; } - QFixed &operator=(long i) { val = i * 64; return *this; } constexpr static QFixed fromReal(qreal r) { return fromFixed((int)(r*qreal(64))); } constexpr static QFixed fromFixed(int fixed) { return QFixed(fixed,0); } // uses private ctor @@ -107,7 +105,6 @@ public: private: constexpr QFixed(qreal i) : val((int)(i*qreal(64))) {} - QFixed &operator=(qreal i) { val = (int)(i*qreal(64)); return *this; } constexpr inline QFixed operator+(qreal i) const { return fromFixed((val + (int)(i*qreal(64)))); } inline QFixed &operator+=(qreal i) { val += (int)(i*64); return *this; } constexpr inline QFixed operator-(qreal i) const { return fromFixed((val - (int)(i*qreal(64)))); }