mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Further simplifications to sqlite3AtoF() to remove unneeded branches.
FossilOrigin-Name: dd69e53cb077873171af5312c633ca185595bf31
This commit is contained in:
11
src/util.c
11
src/util.c
@@ -400,12 +400,13 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
|
||||
z+=incr;
|
||||
/* copy digits from after decimal to significand
|
||||
** (decrease exponent by d to shift decimal right) */
|
||||
while( z<zEnd && sqlite3Isdigit(*z) && s<((LARGEST_INT64-9)/10) ){
|
||||
s = s*10 + (*z - '0');
|
||||
z+=incr, nDigits++, d--;
|
||||
while( z<zEnd && sqlite3Isdigit(*z) ){
|
||||
if( s<((LARGEST_INT64-9)/10) ){
|
||||
s = s*10 + (*z - '0');
|
||||
d--;
|
||||
}
|
||||
z+=incr, nDigits++;
|
||||
}
|
||||
/* skip non-significant digits */
|
||||
while( z<zEnd && sqlite3Isdigit(*z) ) z+=incr, nDigits++;
|
||||
}
|
||||
if( z>=zEnd ) goto do_atof_calc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user