summaryrefslogtreecommitdiffstats
path: root/util/unicode
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-10-18 19:12:21 +0200
committerQt by Nokia <qt-info@nokia.com>2012-02-21 22:31:00 +0100
commit9514138a5ca68341122cff4be2744c995c8ba2c4 (patch)
tree81abbaaf6698d3e7cfdd3065c18d1b60ddaee461 /util/unicode
parent5f049621326bd0236713263c71b0a78f8e7dff3f (diff)
optimize QString::toLower()/toUpper() for special cases, step 2
from now, QUnicodeTables::specialCaseMap[] starts with a placeholder; so, if somethingCaseSpecial is true, then somethingCaseDiff is always greater than 0 Change-Id: Ibb1870512836eee71b1521564c0745096c05b2f9 Merge-request: 70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Olivier Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'util/unicode')
-rw-r--r--util/unicode/main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 40294eba4d..4a11ec667b 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -476,7 +476,10 @@ static int appendToSpecialCaseMap(const QList<int> &map)
utf16map.prepend(length);
specialCaseMaxLen = qMax(specialCaseMaxLen, length);
- int i = 0;
+ if (specialCaseMap.isEmpty())
+ specialCaseMap << 0; // placeholder
+
+ int i = 1;
while (i < specialCaseMap.size()) {
int n = specialCaseMap.at(i);
if (n == length) {
@@ -2251,8 +2254,9 @@ static QByteArray createPropertyInfo()
"}\n\n";
- out += "static const ushort specialCaseMap[] = {";
- int i = 0;
+ out += "static const ushort specialCaseMap[] = {\n";
+ out += " 0x0, // placeholder";
+ int i = 1;
while (i < specialCaseMap.size()) {
out += "\n ";
int n = specialCaseMap.at(i);