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:
parent
1baf8e9ad7
commit
6b2b0cd41b
@ -1264,9 +1264,7 @@ QPageSize &QPageSize::operator=(const QPageSize &other)
|
|||||||
|
|
||||||
bool operator==(const QPageSize &lhs, const QPageSize &rhs)
|
bool operator==(const QPageSize &lhs, const QPageSize &rhs)
|
||||||
{
|
{
|
||||||
if (lhs.d == rhs.d)
|
return lhs.d == rhs.d || *lhs.d == *rhs.d;
|
||||||
return true;
|
|
||||||
return lhs.d && rhs.d && *lhs.d == *rhs.d;
|
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator!=(const QPageSize &lhs, const QPageSize &rhs)
|
\fn bool operator!=(const QPageSize &lhs, const QPageSize &rhs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user