1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Small performance optimization in the allowedOp() routine of the WHERE

clause analysis code.

FossilOrigin-Name: 4ba8be544711e07748e8dd3ca6b81f9897906061c0a1a1bb4fb3808dc27f734b
This commit is contained in:
drh
2024-06-06 00:49:36 +00:00
parent 6593b340ff
commit b458cbb601
3 changed files with 14 additions and 9 deletions

View File

@ -101,7 +101,12 @@ static int allowedOp(int op){
assert( TK_LT>TK_EQ && TK_LT<TK_GE );
assert( TK_LE>TK_EQ && TK_LE<TK_GE );
assert( TK_GE==TK_EQ+4 );
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS;
assert( TK_IN<TK_EQ );
assert( TK_IS<TK_EQ );
assert( TK_ISNULL<TK_EQ );
if( op>TK_GE ) return 0;
if( op>=TK_EQ ) return 1;
return op==TK_IN || op==TK_ISNULL || op==TK_IS;
}
/*