mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Faster column name lookup in the columnIndex() routine using hashing.
FossilOrigin-Name: de2a90812498e504c9b8eeb83bfc48a948b45e87bdfa242c0aa9f0377d90740f
This commit is contained in:
@@ -264,8 +264,10 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
|
||||
*/
|
||||
static int columnIndex(Table *pTab, const char *zCol){
|
||||
int i;
|
||||
for(i=0; i<pTab->nCol; i++){
|
||||
if( sqlite3StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i;
|
||||
u8 h = sqlite3StrIHash(zCol);
|
||||
Column *pCol;
|
||||
for(pCol=pTab->aCol, i=0; i<pTab->nCol; pCol++, i++){
|
||||
if( pCol->hName==h && sqlite3StrICmp(pCol->zName, zCol)==0 ) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user