Remove ASCII cache from QStringHash
authorAaron Kennedy <aaron.kennedy@nokia.com>
Mon, 4 Jul 2011 03:27:59 +0000 (13:27 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 4 Jul 2011 05:27:25 +0000 (07:27 +0200)
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>
src/declarative/qml/v8/qhashedstring_p.h

index 30aedeb..143bd0b 100644 (file)
@@ -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());
     }
 };