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:
parent
c7dd6006b9
commit
1baf8e9ad7
@ -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;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user