1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Avoid unnecessary strlen() calls in sqlite3ExprAssignVarNumber() by passing in

the token length from the parser.

FossilOrigin-Name: d15ae2e530cffea60263f203ac5f89b6790f4bd5
This commit is contained in:
drh
2016-10-03 15:28:24 +00:00
parent 87c05f0c58
commit de25a88c50
5 changed files with 14 additions and 13 deletions

View File

@@ -938,7 +938,7 @@ Expr *sqlite3ExprFunction(Parse *pParse, ExprList *pList, Token *pToken){
** instance of the wildcard, the next sequential variable number is
** assigned.
*/
void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr, u32 n){
sqlite3 *db = pParse->db;
const char *z;
@@ -947,13 +947,13 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
z = pExpr->u.zToken;
assert( z!=0 );
assert( z[0]!=0 );
assert( n==sqlite3Strlen30(z) );
if( z[1]==0 ){
/* Wildcard of the form "?". Assign the next variable number */
assert( z[0]=='?' );
pExpr->iColumn = (ynVar)(++pParse->nVar);
}else{
ynVar x = 0;
u32 n = sqlite3Strlen30(z);
if( z[0]=='?' ){
/* Wildcard of the form "?nnn". Convert "nnn" to an integer and
** use it as the variable number */