From 6b2b0cd41b5a75f5a1f6e8c0313f2e9cce55e64e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 5 Apr 2014 01:13:36 +0200 Subject: [PATCH] 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 Reviewed-by: Thiago Macieira --- src/gui/painting/qpagesize.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/painting/qpagesize.cpp b/src/gui/painting/qpagesize.cpp index 60ca69d1f2a..445c78e530f 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)