1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

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
This commit is contained in:
drh
2025-02-08 14:15:42 +00:00
parent 03c65171b8
commit 9d90a3af2f
10 changed files with 106 additions and 152 deletions

View File

@@ -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;
}