aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qhashedstring_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-07-04 13:27:59 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-04 07:27:25 +0200
commitda931911331b0f8e054578cc329b9d30d376b889 (patch)
treead0f36121b60beaa3c3863a534c389f3d08c6354 /src/declarative/qml/v8/qhashedstring_p.h
parent71114ff964582f58e68d68bf0301cd42110751cc (diff)
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 <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qhashedstring_p.h')
-rw-r--r--src/declarative/qml/v8/qhashedstring_p.h13
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 30aedeb9be..143bd0b995 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<v8::String> 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());
}
};