diff options
author | dan <dan@noemail.net> | 2019-07-10 20:16:53 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-07-10 20:16:53 +0000 |
commit | 8117f113bc0468d4c955ffa3f04cea26a39a3bd3 (patch) | |
tree | ac9b2e9716342e3325d95d1c2a00437dc388a5b5 /src/expr.c | |
parent | 1efcc9dd965c5b48a1a9e27ce760b38f9d892cb4 (diff) | |
download | sqlite-8117f113bc0468d4c955ffa3f04cea26a39a3bd3.tar.gz sqlite-8117f113bc0468d4c955ffa3f04cea26a39a3bd3.zip |
Minor performance improvement in sqlite3ExprDeleteNN().
FossilOrigin-Name: bcc8b38ac75b731a4cd2873ab83f423be036467a511b617c779869de9bbb5383
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/expr.c b/src/expr.c index 75d0dbe9d..6fbeb827f 100644 --- a/src/expr.c +++ b/src/expr.c @@ -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) ){ |