QMetaType: optimize comparison

We can skip the id calls if we know that the pointers are equal.

Change-Id: I62f9cac557d7b82b640a143965f9056a8cd46028
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
bb10
Fabian Kosmale 2020-08-31 19:09:53 +02:00
parent 8ef41d1713
commit 7505422bbf
1 changed files with 1 additions and 1 deletions

View File

@ -437,7 +437,7 @@ public:
static QMetaType fromType();
static QMetaType fromName(QByteArrayView name);
friend bool operator==(QMetaType a, QMetaType b) { return a.id() == b.id(); }
friend bool operator==(QMetaType a, QMetaType b) { return a.d_ptr == b.d_ptr || a.id() == b.id(); }
friend bool operator!=(QMetaType a, QMetaType b) { return !(a == b); }
public: