mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
QTextStream numbers parsing optimizations
QLocale::c() creates temporary QLocale object for the sake of comparison which is sub-optimal much like QLocale::system() but QLocale::c() can be cached in the future or optimized in other ways Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f4bbfdc17a
commit
692168326a
1 changed files with 2 additions and 2 deletions
|
@ -1646,7 +1646,7 @@ QTextStreamPrivate::NumberParsingStatus QTextStreamPrivate::getNumber(qulonglong
|
|||
if (ch.isDigit()) {
|
||||
val *= 10;
|
||||
val += ch.digitValue();
|
||||
} else if (locale != QLocale::c() && ch == locale.groupSeparator()) {
|
||||
} else if (locale.language() != QLocale::C && ch == locale.groupSeparator()) {
|
||||
continue;
|
||||
} else {
|
||||
ungetChar(ch);
|
||||
|
@ -1797,7 +1797,7 @@ bool QTextStreamPrivate::getReal(double *f)
|
|||
else if (lc == locale.negativeSign().toLower()
|
||||
|| lc == locale.positiveSign().toLower())
|
||||
input = InputSign;
|
||||
else if (locale != QLocale::c() // backward-compatibility
|
||||
else if (locale.language() != QLocale::C // backward-compatibility
|
||||
&& lc == locale.groupSeparator().toLower())
|
||||
input = InputDigit; // well, it isn't a digit, but no one cares.
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue