aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-10-03 15:28:24 +0000
committerdrh <drh@noemail.net>2016-10-03 15:28:24 +0000
commitde25a88c507fcd9e60defde4974805ae71a74bc6 (patch)
tree184c7b913afc83dfebe0e7654034d06f0e9f96ab /src/expr.c
parent87c05f0c58b113fbc51b5e3f3a1ca3ce88430a81 (diff)
downloadsqlite-de25a88c507fcd9e60defde4974805ae71a74bc6.tar.gz
sqlite-de25a88c507fcd9e60defde4974805ae71a74bc6.zip
Avoid unnecessary strlen() calls in sqlite3ExprAssignVarNumber() by passing in
the token length from the parser. FossilOrigin-Name: d15ae2e530cffea60263f203ac5f89b6790f4bd5
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 942b2467c..dd0c3cc06 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -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 */