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

Minor performance improvement in sqlite3ExprDeleteNN().

FossilOrigin-Name: bcc8b38ac75b731a4cd2873ab83f423be036467a511b617c779869de9bbb5383
This commit is contained in:
dan
2019-07-10 20:16:53 +00:00
parent 1efcc9dd96
commit 8117f113bc
5 changed files with 41 additions and 32 deletions

View File

@@ -1040,21 +1040,25 @@ static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
assert( p->x.pList==0 || p->pRight==0 );
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
if( p->pRight ){
assert( !ExprHasProperty(p, (EP_WinFunc|EP_Filter)) );
sqlite3ExprDeleteNN(db, p->pRight);
}else if( ExprHasProperty(p, EP_xIsSelect) ){
assert( !ExprHasProperty(p, (EP_WinFunc|EP_Filter)) );
sqlite3SelectDelete(db, p->x.pSelect);
}else{
sqlite3ExprListDelete(db, p->x.pList);
}
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(p, EP_WinFunc) ){
assert( p->op==TK_FUNCTION && !ExprHasProperty(p, EP_Filter) );
sqlite3WindowDelete(db, p->y.pWin);
}else if( ExprHasProperty(p, EP_Filter) ){
assert( p->op==TK_FUNCTION || p->op==TK_AGG_FUNCTION );
sqlite3ExprDelete(db, p->y.pFilter);
}
if( ExprHasProperty(p, (EP_WinFunc|EP_Filter)) ){
if( ExprHasProperty(p, EP_WinFunc) ){
assert( p->op==TK_FUNCTION && !ExprHasProperty(p, EP_Filter) );
sqlite3WindowDelete(db, p->y.pWin);
}else{
assert( p->op==TK_FUNCTION || p->op==TK_AGG_FUNCTION );
sqlite3ExprDeleteNN(db, p->y.pFilter);
}
}
#endif
}
}
if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
if( !ExprHasProperty(p, EP_Static) ){