diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-04-05 01:07:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 22:07:08 +0200 |
commit | 1baf8e9ad723ebc8299ab360f585dd1a35946a97 (patch) | |
tree | c56bcfc4680a76c86ca015f9884dae51bde0cc1c /src/gui | |
parent | c7dd6006b98536a80f02d96e660632ffa150934a (diff) |
QPageLayout: clean up operator==
The old code always compared the Private classes, unless one of them
was nullptr (which it never was, as there is no move ctor and all
other ctors create a QPageLayoutPrivate.
The new code compares the dpointers, and only if they differ, the
Private classes. It also drops the nullptr checks, as they cannot
trigger.
Change-Id: I523c3503e2edb520f98f9b4e2e3bdaf28a9a355d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpagelayout.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/painting/qpagelayout.cpp b/src/gui/painting/qpagelayout.cpp index d9e826bd64..15d98828bf 100644 --- a/src/gui/painting/qpagelayout.cpp +++ b/src/gui/painting/qpagelayout.cpp @@ -438,9 +438,7 @@ QPageLayout &QPageLayout::operator=(const QPageLayout &other) bool operator==(const QPageLayout &lhs, const QPageLayout &rhs) { - if (lhs.d && rhs.d) - return (*lhs.d == *rhs.d); - return (lhs.d == rhs.d); + return lhs.d == rhs.d || *lhs.d == *rhs.d; } /*! |