summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-11-25 11:36:24 +0100
committerLars Knoll <lars.knoll@qt.io>2020-11-26 21:40:02 +0100
commit2721728c9056b442c0281f20792f19eb6a491aa0 (patch)
treec12ed40d5cfc4a26277ade79d333d7c8de3a7de7 /src/corelib/kernel
parent98c82fb445acf45cc4c4bc86a5adda43358127bf (diff)
Optimize code in QTaggedPointer
Don't execute instructions that will never do anything. Directly add the tag to the pointer in the constructor to avoid additional masking operations, and avoid a masking op that is in practice a no-op in setTag(). Do the same optimization in QTagPreservingPointerToPointer. Pick-to: dev Change-Id: Ia364f89cbe6ccc876ec9bda0c239fc4f57c10501 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qpropertyprivate.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qpropertyprivate.h b/src/corelib/kernel/qpropertyprivate.h
index 0edfe5781b..91d9e56d2f 100644
--- a/src/corelib/kernel/qpropertyprivate.h
+++ b/src/corelib/kernel/qpropertyprivate.h
@@ -283,7 +283,7 @@ public:
void setPointer(T *ptr)
{
- *d = (reinterpret_cast<quintptr>(ptr) & QTaggedPointer<T, Tag>::pointerMask()) | (*d & QTaggedPointer<T, Tag>::tagMask());
+ *d = reinterpret_cast<quintptr>(ptr) | (*d & QTaggedPointer<T, Tag>::tagMask());
}
T *get() const