diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-07-10 13:39:20 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-08-24 00:17:04 +0200 |
commit | 76e8e8e9c8093f093cb9f37d61d273f43398fefb (patch) | |
tree | 9fc52a731ac9bae072ee2bf61feb728c7c517917 /src/corelib/kernel/qvariant_p.h | |
parent | cb17157b2762ca5deebe16d4867346437acf3fe0 (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.h | 3 |
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); |