From 388e7504be285151dc10a79662eecdbecf1cd1bc Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Sun, 14 Feb 2021 10:40:15 +0100 Subject: [PATCH] QVariant::Private: select storage in get at compile time Change-Id: I82b0a7ec28400dac64ea785ba6766ca488e615aa Reviewed-by: Thiago Macieira --- src/corelib/kernel/qvariant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index ae39946cc3..d8ef892cb7 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -499,7 +499,7 @@ public: // determine internal storage at compile time template const T &get() const - { return *static_cast(storage()); } + { return *static_cast(CanUseInternalSpace ? &data.data : data.shared->data()); } template void set(const T &t) { *static_cast(CanUseInternalSpace ? &data.data : data.shared->data()) = t; }