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
parent
8ef41d1713
commit
7505422bbf
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue