Fossil SCM
Performance optimization in fossil_strcmp().
Commit
72a4b613479ad77bbfc60c8953cc3da598edcf69e4a78c6f7eda5675c98d42fe
Parent
582d335737f2438…
1 file changed
+1
-6
+1
-6
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -190,16 +190,11 @@ | ||
| 190 | 190 | if( zB==0 ) return 0; |
| 191 | 191 | return -1; |
| 192 | 192 | }else if( zB==0 ){ |
| 193 | 193 | return +1; |
| 194 | 194 | }else{ |
| 195 | - int a, b; | |
| 196 | - do{ | |
| 197 | - a = *zA++; | |
| 198 | - b = *zB++; | |
| 199 | - }while( a==b && a!=0 ); | |
| 200 | - return ((unsigned char)a) - (unsigned char)b; | |
| 195 | + return strcmp(zA,zB); | |
| 201 | 196 | } |
| 202 | 197 | } |
| 203 | 198 | int fossil_strncmp(const char *zA, const char *zB, int nByte){ |
| 204 | 199 | if( zA==0 ){ |
| 205 | 200 | if( zB==0 ) return 0; |
| 206 | 201 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -190,16 +190,11 @@ | |
| 190 | if( zB==0 ) return 0; |
| 191 | return -1; |
| 192 | }else if( zB==0 ){ |
| 193 | return +1; |
| 194 | }else{ |
| 195 | int a, b; |
| 196 | do{ |
| 197 | a = *zA++; |
| 198 | b = *zB++; |
| 199 | }while( a==b && a!=0 ); |
| 200 | return ((unsigned char)a) - (unsigned char)b; |
| 201 | } |
| 202 | } |
| 203 | int fossil_strncmp(const char *zA, const char *zB, int nByte){ |
| 204 | if( zA==0 ){ |
| 205 | if( zB==0 ) return 0; |
| 206 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -190,16 +190,11 @@ | |
| 190 | if( zB==0 ) return 0; |
| 191 | return -1; |
| 192 | }else if( zB==0 ){ |
| 193 | return +1; |
| 194 | }else{ |
| 195 | return strcmp(zA,zB); |
| 196 | } |
| 197 | } |
| 198 | int fossil_strncmp(const char *zA, const char *zB, int nByte){ |
| 199 | if( zA==0 ){ |
| 200 | if( zB==0 ) return 0; |
| 201 |