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

Faster and smaller implementation of sqlite3StrICmp().

FossilOrigin-Name: 7ac500fb5abfe1ad60f2ffdcc8fbe5ccc1c641bbeed53f00940e9ff78788e53d
This commit is contained in:
drh
2019-04-17 11:34:44 +00:00
parent d331c7ab1f
commit 7e427337fe
3 changed files with 16 additions and 13 deletions

View File

@@ -322,12 +322,18 @@ int sqlite3_stricmp(const char *zLeft, const char *zRight){
}
int sqlite3StrICmp(const char *zLeft, const char *zRight){
unsigned char *a, *b;
int c;
int c, x;
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
for(;;){
c = (int)UpperToLower[*a] - (int)UpperToLower[*b];
if( c || *a==0 ) break;
c = *a;
x = *b;
if( c==x ){
if( c==0 ) break;
}else{
c = (int)UpperToLower[c] - (int)UpperToLower[x];
if( c ) break;
}
a++;
b++;
}