1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Faster computation of Expr.nHeight.

FossilOrigin-Name: a7a5af327ba8bafcd58b828e3e7a10d0008bb780d55a6c573aa15896dcc8ab89
This commit is contained in:
drh
2022-02-06 11:51:23 +00:00
parent 17a93ae1b8
commit 2ef111168f
3 changed files with 9 additions and 10 deletions

View File

@@ -769,9 +769,8 @@ static void heightOfSelect(const Select *pSelect, int *pnHeight){
** if appropriate.
*/
static void exprSetHeight(Expr *p){
int nHeight = 0;
heightOfExpr(p->pLeft, &nHeight);
heightOfExpr(p->pRight, &nHeight);
int nHeight = p->pLeft ? p->pLeft->nHeight : 0;
if( p->pRight && p->pRight->nHeight>nHeight ) nHeight = p->pRight->nHeight;
if( ExprUseXSelect(p) ){
heightOfSelect(p->x.pSelect, &nHeight);
}else if( p->x.pList ){