diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-12-12 10:48:32 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-12-13 08:27:54 +0000 |
commit | 4ccba8ea25312e0b635df21ce3fea7624744ee34 (patch) | |
tree | adffd4f8a01f1661094cfc28c8e083df111d6ea1 /src/qml/jsruntime/qv4managed_p.h | |
parent | cf960d2ce277798e1d4f372c6187405fffeaee76 (diff) |
Micro optimization
Avoid checking whether the object is a Managed if we
already know that.
Change-Id: I78234b47269d3eb1a322fdafe7654f91dae7545a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4managed_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4managed_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 86caac3ebe..5c764e7ff0 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -211,6 +211,13 @@ public: return m(); } + template<typename T> inline T *cast() { + return static_cast<T *>(this); + } + template<typename T> inline const T *cast() const { + return static_cast<const T *>(this); + } + private: friend class MemoryManager; friend struct Identifiers; |