1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Performance optimization to sqlite3Dequote() and its callers.

FossilOrigin-Name: 9efe2265b1e70172778d333c5b9d9a76095427ab
This commit is contained in:
drh
2016-04-11 19:01:08 +00:00
parent affa855c94
commit 244b9d6ec6
6 changed files with 24 additions and 29 deletions

View File

@@ -471,15 +471,13 @@ Expr *sqlite3ExprAlloc(
pNew->flags |= EP_IntValue;
pNew->u.iValue = iValue;
}else{
int c;
pNew->u.zToken = (char*)&pNew[1];
assert( pToken->z!=0 || pToken->n==0 );
if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
pNew->u.zToken[pToken->n] = 0;
if( dequote && nExtra>=3
&& ((c = pToken->z[0])=='\'' || c=='"' || c=='[' || c=='`') ){
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){
if( pNew->u.zToken[0]=='"' ) pNew->flags |= EP_DblQuoted;
sqlite3Dequote(pNew->u.zToken);
if( c=='"' ) pNew->flags |= EP_DblQuoted;
}
}
}
@@ -1229,7 +1227,7 @@ void sqlite3ExprListSetName(
pItem = &pList->a[pList->nExpr-1];
assert( pItem->zName==0 );
pItem->zName = sqlite3DbStrNDup(pParse->db, pName->z, pName->n);
if( dequote && pItem->zName ) sqlite3Dequote(pItem->zName);
if( dequote ) sqlite3Dequote(pItem->zName);
}
}