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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user