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

Remove a no-op code path from sqlite3ExprIsInteger(). Replace it with an

assert() that proves it always does nothing.

FossilOrigin-Name: 7af66d1bd53fd5973281646511e4e1d3b16601a3
This commit is contained in:
drh
2011-02-17 15:58:20 +00:00
parent 0cf0e6c912
commit cd92e84d07
3 changed files with 16 additions and 15 deletions

View File

@@ -1198,16 +1198,17 @@ int sqlite3ExprIsConstantOrFunction(Expr *p){
*/
int sqlite3ExprIsInteger(Expr *p, int *pValue){
int rc = 0;
/* If an expression is an integer literal that fits in a signed 32-bit
** integer, then the EP_IntValue flag will have already been set */
assert( p->op!=TK_INTEGER || (p->flags & EP_IntValue)!=0
|| sqlite3GetInt32(p->u.zToken, &rc)==0 );
if( p->flags & EP_IntValue ){
*pValue = p->u.iValue;
return 1;
}
switch( p->op ){
case TK_INTEGER: {
rc = sqlite3GetInt32(p->u.zToken, pValue);
assert( rc==0 );
break;
}
case TK_UPLUS: {
rc = sqlite3ExprIsInteger(p->pLeft, pValue);
break;