summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-03-31 08:54:19 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-03-31 08:54:19 (GMT)
commit400c5eac739c600e745a5467dcfe2c6ada300e2a (patch)
tree592df32c2ff4131522aa9f11948520f57d706745
parent64cdff9b09b42514ef934e61dccba86834eec9b0 (diff)
downloadQt-400c5eac739c600e745a5467dcfe2c6ada300e2a.zip
Qt-400c5eac739c600e745a5467dcfe2c6ada300e2a.tar.gz
Qt-400c5eac739c600e745a5467dcfe2c6ada300e2a.tar.bz2
make the float constructor inline (improves construction/destruction performance by 20%)
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/corelib/kernel/qvariant.h2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 16ca5b0..96e5b4e 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1606,8 +1606,6 @@ QVariant::QVariant(bool val)
{ d.is_null = false; d.type = Bool; d.data.b = val; }
QVariant::QVariant(double val)
{ d.is_null = false; d.type = Double; d.data.d = val; }
-QVariant::QVariant(float val)
-{ d.is_null = false; d.type = QMetaType::Float; d.data.f = val; }
QVariant::QVariant(const QByteArray &val)
{ d.is_null = false; d.type = ByteArray; v_construct<QByteArray>(&d, &val); }
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index ede8074..d73fcbc 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -181,7 +181,7 @@ class Q_CORE_EXPORT QVariant
QVariant(qulonglong ull);
QVariant(bool b);
QVariant(double d);
- QVariant(float f);
+ QVariant(float f) { d.is_null = false; d.type = QMetaType::Float; d.data.f = f; }
#ifndef QT_NO_CAST_FROM_ASCII
QT_ASCII_CAST_WARN_CONSTRUCTOR QVariant(const char *str);
#endif