aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-11-26 18:00:29 +0000
committerdrh <drh@noemail.net>2013-11-26 18:00:29 +0000
commit1b2ee4fe1afb4edd3d04e62daeb133df41809e38 (patch)
tree3f90016343959f3349a8086cb43c38cb4de975a3 /src/tclsqlite.c
parent212c6be1417860712de4b93b31342b72c9fa89dd (diff)
parent55fcab39be8186caac6c7d1262a7c943564623bb (diff)
downloadsqlite-1b2ee4fe1afb4edd3d04e62daeb133df41809e38.tar.gz
sqlite-1b2ee4fe1afb4edd3d04e62daeb133df41809e38.zip
Merge in performance enhancements from trunk.
FossilOrigin-Name: fc9ae839569eb28eb734c52d95676c59b2e27494
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index d9a1e5778..5efc113a6 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -425,13 +425,12 @@ static int safeToUseEvalObjv(Tcl_Interp *interp, Tcl_Obj *pCmd){
*/
static SqlFunc *findSqlFunc(SqliteDb *pDb, const char *zName){
SqlFunc *p, *pNew;
- int i;
- pNew = (SqlFunc*)Tcl_Alloc( sizeof(*pNew) + strlen30(zName) + 1 );
+ int nName = strlen30(zName);
+ pNew = (SqlFunc*)Tcl_Alloc( sizeof(*pNew) + nName + 1 );
pNew->zName = (char*)&pNew[1];
- for(i=0; zName[i]; i++){ pNew->zName[i] = tolower(zName[i]); }
- pNew->zName[i] = 0;
+ memcpy(pNew->zName, zName, nName+1);
for(p=pDb->pFunc; p; p=p->pNext){
- if( strcmp(p->zName, pNew->zName)==0 ){
+ if( sqlite3_stricmp(p->zName, pNew->zName)==0 ){
Tcl_Free((char*)pNew);
return p;
}
@@ -1127,13 +1126,14 @@ static int dbPrepareAndBind(
int nSql; /* Length of zSql in bytes */
int nVar; /* Number of variables in statement */
int iParm = 0; /* Next free entry in apParm */
+ char c;
int i;
Tcl_Interp *interp = pDb->interp;
*ppPreStmt = 0;
/* Trim spaces from the start of zSql and calculate the remaining length. */
- while( isspace(zSql[0]) ){ zSql++; }
+ while( (c = zSql[0])==' ' || c=='\t' || c=='\r' || c=='\n' ){ zSql++; }
nSql = strlen30(zSql);
for(pPreStmt = pDb->stmtList; pPreStmt; pPreStmt=pPreStmt->pNext){