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>
This commit is contained in:
Marc Mutz 2014-04-05 01:07:39 +02:00 committed by The Qt Project
parent c7dd6006b9
commit 1baf8e9ad7

View File

@ -438,9 +438,7 @@ QPageLayout &QPageLayout::operator=(const QPageLayout &other)
bool operator==(const QPageLayout &lhs, const QPageLayout &rhs) bool operator==(const QPageLayout &lhs, const QPageLayout &rhs)
{ {
if (lhs.d && rhs.d) return lhs.d == rhs.d || *lhs.d == *rhs.d;
return (*lhs.d == *rhs.d);
return (lhs.d == rhs.d);
} }
/*! /*!