From 1baf8e9ad723ebc8299ab360f585dd1a35946a97 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 5 Apr 2014 01:07:39 +0200 Subject: QPageLayout: clean up operator== The old code always compared the Private classes, unless one of them was nullptr (which it never was, as there is no move ctor and all other ctors create a QPageLayoutPrivate. The new code compares the dpointers, and only if they differ, the Private classes. It also drops the nullptr checks, as they cannot trigger. Change-Id: I523c3503e2edb520f98f9b4e2e3bdaf28a9a355d Reviewed-by: Friedemann Kleint --- src/gui/painting/qpagelayout.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qpagelayout.cpp b/src/gui/painting/qpagelayout.cpp index d9e826bd64..15d98828bf 100644 --- a/src/gui/painting/qpagelayout.cpp +++ b/src/gui/painting/qpagelayout.cpp @@ -438,9 +438,7 @@ QPageLayout &QPageLayout::operator=(const QPageLayout &other) bool operator==(const QPageLayout &lhs, const QPageLayout &rhs) { - if (lhs.d && rhs.d) - return (*lhs.d == *rhs.d); - return (lhs.d == rhs.d); + return lhs.d == rhs.d || *lhs.d == *rhs.d; } /*! -- cgit v1.2.3