JSON: use the new isLatin1 function

It's vectorized, so it should be faster than this version.

Change-Id: I56b444f9d6274221a3b7fffd150c1519eb999cdc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Thiago Macieira 2018-01-22 00:39:06 -08:00
parent c375503fa0
commit 08559d2b77
1 changed files with 1 additions and 8 deletions

View File

@ -154,14 +154,7 @@ static inline bool useCompressed(const QString &s)
{
if (s.length() >= 0x8000)
return false;
const ushort *uc = (const ushort *)s.constData();
const ushort *e = uc + s.length();
while (uc < e) {
if (*uc > 0xff)
return false;
++uc;
}
return true;
return QtPrivate::isLatin1(s);
}
static inline int qStringSize(const QString &string, bool compress)