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

Performance improvement in sqlite3VarintLen().

FossilOrigin-Name: adf9fefb00ae1dbb07a921c6796cb0a9505c6d19
This commit is contained in:
drh
2015-09-01 22:29:07 +00:00
parent 054bbabc76
commit 59a5364cf9
3 changed files with 9 additions and 12 deletions

View File

@@ -1065,11 +1065,8 @@ u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){
** 64-bit integer.
*/
int sqlite3VarintLen(u64 v){
int i = 0;
do{
i++;
v >>= 7;
}while( v!=0 && ALWAYS(i<9) );
int i;
for(i=1; (v >>= 7)!=0; i++){ assert( i<9 ); }
return i;
}