diff options
author | drh <> | 2022-02-06 11:51:23 +0000 |
---|---|---|
committer | drh <> | 2022-02-06 11:51:23 +0000 |
commit | 2ef111168f03f90970ea17c3584efd654d8bff83 (patch) | |
tree | 9c3619976086281b7fa06490d87a5aea89f349bf /src | |
parent | 17a93ae1b8a6c7c5ffa76e42037e8ac2d9c5c322 (diff) | |
download | sqlite-2ef111168f03f90970ea17c3584efd654d8bff83.tar.gz sqlite-2ef111168f03f90970ea17c3584efd654d8bff83.zip |
Faster computation of Expr.nHeight.
FossilOrigin-Name: a7a5af327ba8bafcd58b828e3e7a10d0008bb780d55a6c573aa15896dcc8ab89
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index 4c47f6fe6..271f06bc6 100644 --- a/src/expr.c +++ b/src/expr.c @@ -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 ){ |