String optimization.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-04-22 19:06:34 +03:00
parent ab59a76bbb
commit 2c6c537d66

View File

@ -54,19 +54,24 @@ QmuFormulaBase::~QmuFormulaBase()
*/ */
void QmuFormulaBase::InitCharSets() void QmuFormulaBase::InitCharSets()
{ {
QString symbolsStr;
{
//String with all unique symbols for supported alphabets. //String with all unique symbols for supported alphabets.
//See script alphabets.py for generation and more information. //See script alphabets.py for generation and more information.
//Note. MSVC doesn't support normal string concatenation for long string. That's why we use QStringList in this //Note. MSVC doesn't support normal string concatenation for long string. That's why we use QStringList in this
//case. //case.
const QStringList symbols = QStringList() const QStringList symbols
<< "ցЀĆЈVӧĎАғΕĖӅИқΝĞơРңњΥҔĦШҫ̆جگĮаҳѕεشԶиһνԾрÃυلՆӝшËՎїPÓՖXӛӟŞãզhëծpóӞնxßվāŁЃֆĉЋ" {
<< "CŬđҐГΒęҘЛΚŘġҠУGاհЫدԱҰгβطԹõлκKՁÀуςهՉÈыvیՑÐSOřӘћաőcӐթèkàѓżűðsķչøӥӔĀփӣІĈЎ" QStringLiteral("ցЀĆЈVӧĎАғΕĖӅИқΝĞơРңњΥҔĦШҫ̆جگĮаҳѕεشԶиһνԾрÃυلՆӝшËՎїPÓՖXӛӟŞãզhëծpóӞնxßվāŁЃֆĉЋCŬđҐГΒęҘЛΚŘġҠУGاհ"),
<< "ґĐΗЖҙĘȚΟОҡĠآΧЦتЮұİزηжԸغẽοоÁՀقχцÉՈيюÑՐђӋіәťӆўáŠĺѐfөըnñŰӤӨӹոľЁրăЉŭċБӸēłΔҖ" QStringLiteral("ЫدԱҰгβطԹõлκKՁÀуςهՉÈыvیՑÐSOřӘћաőcӐթèkàѓżűðsķչøӥӔĀփӣІĈЎґĐΗЖҙĘȚΟОҡĠآΧЦتЮұİزηжԸغẽοоÁՀقχцÉՈيюÑՐђӋі"),
<< "ЙŤěΜӜDСձģΤӰЩīņحҮбưԳصδHйԻŇμӲӴсՃمτƠщՋєLQŹՓŕÖYśÞaգĽæiŽիӓîqճöyջþĂօЄӦĊЌΑĒДҗј" QStringLiteral("әťӆўáŠĺѐfөըnñŰӤӨӹոľЁրăЉŭċБӸēłΔҖЙŤěΜӜDСձģΤӰЩīņحҮбưԳصδHйԻŇμӲӴсՃمτƠщՋєLQŹՓŕÖYśÞaգĽæiŽիӓîqճöyջþĂ"),
<< "ΙȘĚМΡéĵĢФūӚΩبĪЬүќαذԲдҷιظԺмρՂфÇωوՊьÏՒTŚĻJբdçժlïӪղtպӫAւąЇčŃЏĕӯЗΖEțŮĝПΞأĥ" QStringLiteral("օЄӦĊЌΑĒДҗјΙȘĚМΡéĵĢФūӚΩبĪЬүќαذԲдҷιظԺмρՂфÇωوՊьÏՒTŚĻJբdçժlïӪղtպӫAւąЇčŃЏĕӯЗΖEțŮĝПΞأĥĹЧΦثÆӳЯI"),
<< "ĹЧΦثÆӳЯIسŲԵзζԽпξكՅÄчφNMՍӌяӢՕÔWÎŝÜџёźեägխoӒյôwĶBžսüЂĄև̈ЊČƏљΓВҕĔӮΛКĜΣТҥĤک" QStringLiteral("سŲԵзζԽпξكՅÄчφNMՍӌяӢՕÔWÎŝÜџёźեägխoӒյôwĶBžսüЂĄև̈ЊČƏљΓВҕĔӮΛКĜΣТҥĤکЪƯخγвŅԴŪضλкԼĴσтÅՄنъÍՌRӕՔZÝŜ"),
<< "ЪƯخγвŅԴŪضλкԼĴσтÅՄنъÍՌRӕՔZÝŜbåդjíլļrӵմzýռپêЅքćچЍďӱҒЕůėژșΘØҚНğńءΠFҢХħΨҪ" QStringLiteral("båդjíլļrӵմzýռپêЅքćچЍďӱҒЕůėژșΘØҚНğńءΠFҢХħΨҪЭųįҶرҲеԷňعθҺнԿفπÂхՇψÊэšՏÒUəÚѝŻşҤӑâeէŐımկòuշÕúտŔ")
<< "ЭųįҶرҲеԷňعθҺнԿفπÂхՇψÊэšՏÒUəÚѝŻşҤӑâeէŐımկòuշÕúտŔ"; };
symbolsStr = symbols.join(QString());
}
INIT_LOCALE_VARIABLES(m_locale); INIT_LOCALE_VARIABLES(m_locale);
Q_UNUSED(expUpper) Q_UNUSED(expUpper)
@ -76,13 +81,15 @@ void QmuFormulaBase::InitCharSets()
// Defining identifier character sets // Defining identifier character sets
const QString nameChars = QString() + sign0 + sign1 + sign2 + sign3 + sign4 + sign5 + sign6 + sign7 + sign8 + const QString nameChars = QString() + sign0 + sign1 + sign2 + sign3 + sign4 + sign5 + sign6 + sign7 + sign8 +
sign9 + QLatin1String("\\_@#'") + symbols.join(QString()); sign9 + QStringLiteral("\\_@#'") + symbolsStr;
DefineNameChars(nameChars); DefineNameChars(nameChars);
const QString oprtChars = symbols.join(QString()) + positiveSign + negativeSign + QLatin1String("*^/?<>=!$%&|~'_"); const QString opChars = QStringLiteral("*^/?<>=!$%&|~'_");
const QString oprtChars = symbolsStr + positiveSign + negativeSign + opChars;
DefineOprtChars(oprtChars); DefineOprtChars(oprtChars);
const QString infixOprtChars = QString() + positiveSign + negativeSign + QLatin1String("*^/?<>=!$%&|~'_"); const QString infixOprtChars = QString() + positiveSign + negativeSign + opChars;
DefineInfixOprtChars(infixOprtChars); DefineInfixOprtChars(infixOprtChars);
} }