From: Aaron Kennedy Date: Fri, 15 Jul 2011 08:08:51 +0000 (+1000) Subject: Remove unnecessary toString() X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9598e3da45b18832b7f320e82cec6ded062339c0;p=konrad%2Fqtdeclarative.git Remove unnecessary toString() Change-Id: I0c39bf9c96d65ba1ed4faffffebfd9b89016b3d7 Reviewed-on: http://codereview.qt.nokia.com/3751 Reviewed-by: Roberto Raggi Reviewed-by: Qt Sanity Bot --- diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 29f8845..708f2bc 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1415,9 +1415,9 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDecl { Q_ASSERT(obj->metaObject()); - QString name = prop->name().toString(); - Q_ASSERT(name.startsWith(on_string)); - name = name.mid(2); + QStringRef propName = prop->name(); + Q_ASSERT(propName.startsWith(on_string)); + QString name = propName.string()->mid(propName.position() + 2, propName.length() - 2); // Note that the property name could start with any alpha or '_' or '$' character, // so we need to do the lower-casing of the first alpha character. @@ -1433,7 +1433,7 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDecl if (sigIdx == -1) { - if (notInRevision && -1 == indexOfProperty(obj, prop->name(), 0)) { + if (notInRevision && -1 == indexOfProperty(obj, propName, 0)) { Q_ASSERT(obj->type != -1); const QList &resolvedTypes = unit->resolvedTypes(); const QDeclarativeTypeData::TypeReference &type = resolvedTypes.at(obj->type);