From da931911331b0f8e054578cc329b9d30d376b889 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 4 Jul 2011 13:27:59 +1000 Subject: [PATCH] Remove ASCII cache from QStringHash Now that we have symbol ids, we struggle to recover the time spent creating the ascii hash. We can reintroduce it if we need to. Change-Id: Icb2adac6bbe69f94050e57418b7a8a7bfdb7e221 Reviewed-on: http://codereview.qt.nokia.com/1027 Reviewed-by: Qt Sanity Bot Reviewed-by: Aaron Kennedy --- src/declarative/qml/v8/qhashedstring_p.h | 13 +------------ 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/src/declarative/qml/v8/qhashedstring_p.h b/src/declarative/qml/v8/qhashedstring_p.h index 30aedeb..143bd0b 100644 --- a/src/declarative/qml/v8/qhashedstring_p.h +++ b/src/declarative/qml/v8/qhashedstring_p.h @@ -139,26 +139,15 @@ class QStringHashNode public: QStringHashNode(const QHashedString &key) : nlist(0), next(0), key(key), symbolId(0) { - if (isAscii()) ascii = key.toAscii(); } QStringHashNode *nlist; QStringHashNode *next; QHashedString key; - QByteArray ascii; quint32 symbolId; inline bool equals(v8::Handle string) { - return !ascii.isEmpty() && string->Equals((char*)ascii.constData(), ascii.length()) || - ascii.isEmpty() && string->Equals((uint16_t*)key.constData(), key.length()); - } -private: - bool isAscii() const { - for (int ii = 0; ii < key.length(); ++ii) { - if (key.at(ii) > 127) - return false; - } - return true; + return string->Equals((uint16_t*)key.constData(), key.length()); } }; -- 1.7.2.5