Don't convert to a temporary QString just to compute it's hash
authorLars Knoll <lars.knoll@digia.com>
Fri, 28 Jun 2013 06:49:16 +0000 (08:49 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 28 Jun 2013 12:56:35 +0000 (14:56 +0200)
Change-Id: I45fbd4a6304dd2f771d75a47a2ddf162705887b5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/ftw/qhashedstring.cpp

index 0af68e8..7e6ea59 100644 (file)
@@ -48,8 +48,7 @@ inline quint32 stringHash(const QChar* data, int length)
 
 inline quint32 stringHash(const char *data, int length)
 {
-    QString s = QString::fromLatin1(data, length);
-    return QV4::String::createHashValue(s.constData(), s.length());
+    return QV4::String::createHashValue(data, length);
 }
 
 void QHashedString::computeHash() const