mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Performance optimization in sqlite3ExprAssignVarNumber().
FossilOrigin-Name: 5987ca1ff94ed3c1666f783bb15b16158aa7e1db
This commit is contained in:
@@ -967,7 +967,13 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr, u32 n){
|
||||
/* Wildcard of the form "?nnn". Convert "nnn" to an integer and
|
||||
** use it as the variable number */
|
||||
i64 i;
|
||||
int bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
|
||||
int bOk;
|
||||
if( n==2 ){ /*OPTIMIZATION-IF-TRUE*/
|
||||
i = z[1]-'0'; /* The common case of ?N for a single digit N */
|
||||
bOk = 1;
|
||||
}else{
|
||||
bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
|
||||
}
|
||||
x = (ynVar)i;
|
||||
testcase( i==0 );
|
||||
testcase( i==1 );
|
||||
|
||||
Reference in New Issue
Block a user