QLocaleData::numberToCLocale(): consolidate two branches
The handling of a digit was done in two parts, separating the case for the first digit from the handling of later digits. Nothing in the else/if chain between involved digits, so the latter can move to the front and be combined with the former. Change-Id: I4c93515f36452721bdef472cc2f0af7ceeb00527 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
23a854c3a6
commit
89c6271af0
|
|
@ -3948,9 +3948,10 @@ bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_o
|
|||
}
|
||||
|
||||
if (!number_options.testFlag(QLocale::RejectGroupSeparator)) {
|
||||
if (start_of_digits_idx == -1 && out >= '0' && out <= '9') {
|
||||
start_of_digits_idx = idx;
|
||||
digitsInGroup++;
|
||||
if (out >= '0' && out <= '9') {
|
||||
if (start_of_digits_idx == -1)
|
||||
start_of_digits_idx = idx;
|
||||
++digitsInGroup;
|
||||
} else if (out == ',') {
|
||||
// Don't allow group chars after the decimal point or exponent
|
||||
if (decpt_idx != -1 || exponent_idx != -1)
|
||||
|
|
@ -3979,8 +3980,6 @@ bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_o
|
|||
|
||||
// stop processing separators
|
||||
last_separator_idx = -1;
|
||||
} else if (out >= '0' && out <= '9') {
|
||||
digitsInGroup++;
|
||||
}
|
||||
} else if (out == ',') {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue