From 173e2c1ba81b9a2665c040a9e86d085131e5042e Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Thu, 20 May 2010 10:46:12 +0200 Subject: nano optimization of canonicalOrderHelper() by inlining & merging QChar::combiningClass() and QChar::unicodeVersion() Merge-request: 2393 Reviewed-by: Olivier Goffart --- src/corelib/tools/qchar.cpp | 20 +++++++++++++------- 1 file 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(); -- cgit v0.12