summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-04-05 01:13:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-08 22:07:16 +0200
commit6b2b0cd41b5a75f5a1f6e8c0313f2e9cce55e64e (patch)
treee4c25488f53677177d50121082c15fbd53ae5448 /src
parent1baf8e9ad723ebc8299ab360f585dd1a35946a97 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpagesize.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/painting/qpagesize.cpp b/src/gui/painting/qpagesize.cpp
index 60ca69d1f2..445c78e530 100644
--- a/src/gui/painting/qpagesize.cpp
+++ b/src/gui/painting/qpagesize.cpp
@@ -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)