1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Change so that deleting an Expr structure requires only one frame per level in the expression tree, not two.

FossilOrigin-Name: a4380ab326e4b0de29271c824d041193e86b7139
This commit is contained in:
dan
2009-11-23 14:39:14 +00:00
parent fc7e7c7c84
commit f6963f99dd
5 changed files with 20 additions and 34 deletions

View File

@@ -627,11 +627,10 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
}
/*
** Clear an expression structure without deleting the structure itself.
** Substructure is deleted.
** Recursively delete an expression tree.
*/
void sqlite3ExprClear(sqlite3 *db, Expr *p){
assert( p!=0 );
void sqlite3ExprDelete(sqlite3 *db, Expr *p){
if( p==0 ) return;
if( !ExprHasAnyProperty(p, EP_TokenOnly) ){
sqlite3ExprDelete(db, p->pLeft);
sqlite3ExprDelete(db, p->pRight);
@@ -644,14 +643,6 @@ void sqlite3ExprClear(sqlite3 *db, Expr *p){
sqlite3ExprListDelete(db, p->x.pList);
}
}
}
/*
** Recursively delete an expression tree.
*/
void sqlite3ExprDelete(sqlite3 *db, Expr *p){
if( p==0 ) return;
sqlite3ExprClear(db, p);
if( !ExprHasProperty(p, EP_Static) ){
sqlite3DbFree(db, p);
}