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

Further simplification of the reverse-order scan logic of the previous

check-in.

FossilOrigin-Name: b2b0e23ba885f22c88b03492e42c3cd1cbd59289e452263951bb757a871699f0
This commit is contained in:
drh
2021-05-12 22:15:44 +00:00
parent 0564cc2601
commit 7ffb16b495
3 changed files with 8 additions and 10 deletions

View File

@@ -1749,9 +1749,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
** a forward order scan on a descending index, interchange the
** start and end terms (pRangeStart and pRangeEnd).
*/
if( (nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC))
|| (bRev && pIdx->nColumn==nEq)
){
if( (nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) ){
SWAP(WhereTerm *, pRangeEnd, pRangeStart);
SWAP(u8, bSeekPastNull, bStopAtNull);
SWAP(u8, nBtm, nTop);