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>
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());
}
};