diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-04-08 14:44:46 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2025-04-11 20:59:59 +0200 |
| commit | 1445a33b6fd4c7a401edf68e325e4527e18a667a (patch) | |
| tree | a83d781fbebe263a910a49428e0c90dc5a62f9df /src/corelib/kernel/qmetaobject.cpp | |
| parent | 5d2164382cfaa6458731714e335b56002f865a33 (diff) | |
QMetaObject: save a strlen() in typeFromTypeInfo()
QMetaType::fromName() takes a QBAV, so don't feed it rawStringData()
(a const char*, causing the QBAV ctor to run strlen() on it), but
stringDataView() (a QBAV already, whose length is determined by offset
difference in the string offset table and not by strlen()).
No measurable difference in runtime speed.
Pick-to: 6.9 6.8 6.5
Change-Id: I583bea9d818deeaac6f62803f7ac5ab4766cb8a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 969e335a212..9dd9c7eee43 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -165,7 +165,7 @@ static inline int typeFromTypeInfo(const QMetaObject *mo, uint typeInfo) { if (!(typeInfo & IsUnresolvedType)) return typeInfo; - return QMetaType::fromName(rawStringData(mo, typeInfo & TypeNameIndexMask)).id(); + return QMetaType::fromName(stringDataView(mo, typeInfo & TypeNameIndexMask)).id(); } static auto parse_scope(QByteArrayView qualifiedKey) noexcept |
