diff options
author | drh <> | 2025-02-08 14:15:42 +0000 |
---|---|---|
committer | drh <> | 2025-02-08 14:15:42 +0000 |
commit | 9d90a3af2fa1108ee3c914f9cb5b602bfb04949d (patch) | |
tree | e41f27f557b6df1df69d32f543e6c19916270624 /src/expr.c | |
parent | 03c65171b8ff533b28927a1e5fb7939b87077de0 (diff) | |
download | sqlite-9d90a3af2fa1108ee3c914f9cb5b602bfb04949d.tar.gz sqlite-9d90a3af2fa1108ee3c914f9cb5b602bfb04949d.zip |
Use the sqlite3ColumnIndex() routine to look up a column in a table, rather
than using a custom loop. Performance improvement, size reduction, and
complexity decrease.
FossilOrigin-Name: 351dbbc2bf0b23efdc625ddaa5dc2239cf2990addf071a04bd41612b341de8c8
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/expr.c b/src/expr.c index 8f898a1e3..df47e3459 100644 --- a/src/expr.c +++ b/src/expr.c @@ -2966,13 +2966,7 @@ const char *sqlite3RowidAlias(Table *pTab){ int ii; assert( VisibleRowid(pTab) ); for(ii=0; ii<ArraySize(azOpt); ii++){ - int iCol; - for(iCol=0; iCol<pTab->nCol; iCol++){ - if( sqlite3_stricmp(azOpt[ii], pTab->aCol[iCol].zCnName)==0 ) break; - } - if( iCol==pTab->nCol ){ - return azOpt[ii]; - } + if( sqlite3ColumnIndex(pTab, azOpt[ii])<0 ) return azOpt[ii]; } return 0; } |