summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-07-10 13:39:20 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-24 00:17:04 +0200
commit76e8e8e9c8093f093cb9f37d61d273f43398fefb (patch)
tree9fc52a731ac9bae072ee2bf61feb728c7c517917 /src/corelib/kernel/qvariant_p.h
parentcb17157b2762ca5deebe16d4867346437acf3fe0 (diff)
Always use the variants internal space if possible
There's no point in storing small types with an external refcount, even if they aren't movable. Simply copying the type should be faster in pretty much all cases, while this uses less memory. Change-Id: I127474f8e3c5fa042f530684f9d5bfccbba134ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qvariant_p.h')
-rw-r--r--src/corelib/kernel/qvariant_p.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 0682d1d6b3..f92f97d836 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -63,8 +63,7 @@ QT_BEGIN_NAMESPACE
template<typename T>
struct QVariantIntegrator
{
- static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data)
- && ((QTypeInfoQuery<T>::isRelocatable) || std::is_enum<T>::value);
+ static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data);
typedef std::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
};
static_assert(QVariantIntegrator<double>::CanUseInternalSpace);