aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-07-07 13:59:34 +0000
committerdrh <drh@noemail.net>2017-07-07 13:59:34 +0000
commitd10866798dbd40430454681fc0da450cf6065af7 (patch)
tree7a71c7bb5045cda1b47152fc77f8367e0bd61d6f /src/expr.c
parentc2d14a9a334cdd6a043ceb0f7eaebe184310a0c5 (diff)
downloadsqlite-d10866798dbd40430454681fc0da450cf6065af7.tar.gz
sqlite-d10866798dbd40430454681fc0da450cf6065af7.zip
Exploit the fact that Expr.pRight and Expr.x are never used at the same time
for a small performance gain. FossilOrigin-Name: aacbb9a461fdb34c7f9c8ce348e44c3e96c93334f210d438d92bfac1794dc686
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 2e8b19603..28416286a 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1025,8 +1025,9 @@ static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
/* The Expr.x union is never used at the same time as Expr.pRight */
assert( p->x.pList==0 || p->pRight==0 );
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
- sqlite3ExprDelete(db, p->pRight);
- if( ExprHasProperty(p, EP_xIsSelect) ){
+ if( p->pRight ){
+ sqlite3ExprDeleteNN(db, p->pRight);
+ }else if( ExprHasProperty(p, EP_xIsSelect) ){
sqlite3SelectDelete(db, p->x.pSelect);
}else{
sqlite3ExprListDelete(db, p->x.pList);