QmlDesigner: Use QStringView to avoid some allocations

std::ranges would be even more optimal but we can do that later.

Change-Id: I81a949bc1f9149e8a33bed88dc5ff9a9949bdc20
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2024-12-23 08:48:58 +01:00
parent 9803eeee2b
commit d3aede431b
2 changed files with 3 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ public:
: m_enumerationName{text, static_cast<qsizetype>(std::strlen(text))}
{}
Enumeration(const QString &enumerationName)
Enumeration(QStringView enumerationName)
: m_enumerationName(enumerationName.toUtf8())
{}

View File

@@ -550,9 +550,9 @@ public:
const NodeMetaInfo &metaInfo,
const QString &propertyPrefix,
AST::UiQualifiedId *propertyId,
const QString &astValue)
QStringView astValue)
{
QStringList astValueList = astValue.split(u'.');
QList<QStringView> astValueList = astValue.split(u'.');
if (astValueList.size() == 2) {
//Check for global Qt enums