diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-05-20 08:46:12 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-05-20 08:46:12 (GMT) |
commit | 173e2c1ba81b9a2665c040a9e86d085131e5042e (patch) | |
tree | 1aa92873e2b3cac03ef10189e3cb3c7e1b404b39 /src/corelib/tools/qchar.cpp | |
parent | 8e5ac76a2907a7a89b31ed562b5d086adaad5faf (diff) | |
download | Qt-173e2c1ba81b9a2665c040a9e86d085131e5042e.zip Qt-173e2c1ba81b9a2665c040a9e86d085131e5042e.tar.gz Qt-173e2c1ba81b9a2665c040a9e86d085131e5042e.tar.bz2 |
nano optimization of canonicalOrderHelper()
by inlining & merging QChar::combiningClass() and QChar::unicodeVersion()
Merge-request: 2393
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/corelib/tools/qchar.cpp')
-rw-r--r-- | src/corelib/tools/qchar.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index c3e9f0e..ed0af4e 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1584,17 +1584,23 @@ static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, in } } - int c2 = QChar::combiningClass(u2); - if (QChar::unicodeVersion(u2) > version) - c2 = 0; - + ushort c2 = 0; + { + const QUnicodeTables::Properties *p = qGetProp(u2); + if ((QChar::UnicodeVersion)p->unicodeVersion <= version) + c2 = p->combiningClass; + } if (c2 == 0) { pos = p2+1; continue; } - int c1 = QChar::combiningClass(u1); - if (QChar::unicodeVersion(u1) > version) - c1 = 0; + + ushort c1 = 0; + { + const QUnicodeTables::Properties *p = qGetProp(u1); + if ((QChar::UnicodeVersion)p->unicodeVersion <= version) + c1 = p->combiningClass; + } if (c1 > c2) { QChar *uc = s.data(); |