diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-11-24 15:39:07 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-11-29 19:59:58 +0000 |
commit | 6b641549536d199a0314049a34e61363bd4df7e0 (patch) | |
tree | 1a2f68d61862ede6a06a126d18a5435a0a0bb346 /src/qml/jsruntime/qv4value_p.h | |
parent | 58d0fc4dcf99b867d1f0bd67327105983ec36e07 (diff) |
Clean up duplicated checks whether a Value is a Managed
Change-Id: Ib044be254dbb41bd9fb4a6e0baa3bd3c007e6a2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 29d8f196ee..e9a5b569a2 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -374,17 +374,17 @@ public: QML_NEARLY_ALWAYS_INLINE String *stringValue() const { if (!isString()) return nullptr; - return m() ? reinterpret_cast<String*>(const_cast<Value *>(this)) : 0; + return reinterpret_cast<String*>(const_cast<Value *>(this)); } QML_NEARLY_ALWAYS_INLINE Object *objectValue() const { if (!isObject()) return nullptr; - return m() ? reinterpret_cast<Object*>(const_cast<Value *>(this)) : 0; + return reinterpret_cast<Object*>(const_cast<Value *>(this)); } QML_NEARLY_ALWAYS_INLINE Managed *managed() const { if (!isManaged()) return nullptr; - return m() ? reinterpret_cast<Managed*>(const_cast<Value *>(this)) : 0; + return reinterpret_cast<Managed*>(const_cast<Value *>(this)); } QML_NEARLY_ALWAYS_INLINE Heap::Base *heapObject() const { return isManaged() ? m() : nullptr; @@ -420,7 +420,7 @@ public: template <typename T> const T *as() const { - if (!m() || !isManaged()) + if (!isManaged()) return 0; Q_ASSERT(m()->vtable()); @@ -487,13 +487,13 @@ inline bool Value::isString() const { if (!isManaged()) return false; - return m() && m()->vtable()->isString; + return m()->vtable()->isString; } inline bool Value::isObject() const { if (!isManaged()) return false; - return m() && m()->vtable()->isObject; + return m()->vtable()->isObject; } inline bool Value::isPrimitive() const |