QPageSize: clean up operator==

Recognize that the d-pointer can never be nullptr and drop the
nullptr checks.

The d-pointer can never be nullptr as there's no move ctor and all other
ctors create a QPageSizePrivate.

Change-Id: I6c4e165949ed55510aefbc2d933f20fc8e624333
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2014-04-05 01:13:36 +02:00 committed by The Qt Project
parent 1baf8e9ad7
commit 6b2b0cd41b

View File

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