diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-07 16:07:16 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-07-08 22:14:52 +0200 |
commit | 9b92f599406aaf218fd2be2f290dc4938049ade1 (patch) | |
tree | f3c92c5f60a3464255dcf1ca333426e22ba0b3c4 /src/gui/painting | |
parent | 464607abb9e2528c2e1ccf41eec7c28703df8e2a (diff) |
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.
Pick-to: 6.4
Change-Id: Ia5b0364617a646f3cf122b47363d6099548bb5c2
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qfixed_p.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/gui/painting/qfixed_p.h b/src/gui/painting/qfixed_p.h index da69f901cd..de52e2e815 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)))); } |