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

Performance improvement for column name lookup.

FossilOrigin-Name: 1e4b6a93987cdfbf829e2ff35ef417c290625f2894ad11949e301af518f1fb44
This commit is contained in:
drh
2020-04-06 18:16:31 +00:00
parent 85f2c76cf9
commit d44390c8c5
8 changed files with 37 additions and 15 deletions

View File

@@ -317,6 +317,19 @@ int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b];
}
/*
** Compute an 8-bit hash on a string that is insensitive to case differences
*/
u8 sqlite3StrIHash(const char *z){
u8 h = 0;
if( z==0 ) return 0;
while( z[0] ){
h += UpperToLower[(unsigned char)z[0]];
z++;
}
return h;
}
/*
** Compute 10 to the E-th power. Examples: E==1 results in 10.
** E==2 results in 100. E==50 results in 1.0e50.