diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-04-05 01:13:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 22:07:16 +0200 |
commit | 6b2b0cd41b5a75f5a1f6e8c0313f2e9cce55e64e (patch) | |
tree | e4c25488f53677177d50121082c15fbd53ae5448 /src/gui/painting/qpagesize.cpp | |
parent | 1baf8e9ad723ebc8299ab360f585dd1a35946a97 (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/gui/painting/qpagesize.cpp')
-rw-r--r-- | src/gui/painting/qpagesize.cpp | 4 |
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) |