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

Faster decoding of 32-bit variable-length integers in cases were we do not

need to know the number of bytes in the encoding.

FossilOrigin-Name: 59a31b16b54a0068c81ee65bc2fa905c2c826e98da3a7ffd8c3ea860a2827b4a
This commit is contained in:
drh
2020-01-28 20:27:42 +00:00
parent 925ab5c17e
commit 02a95eb9bb
5 changed files with 18 additions and 16 deletions

View File

@@ -4426,6 +4426,8 @@ int sqlite3VarintLen(u64 v);
*/
#define getVarint32(A,B) \
(u8)((*(A)<(u8)0x80)?((B)=(u32)*(A)),1:sqlite3GetVarint32((A),(u32 *)&(B)))
#define getVarint32NR(A,B) \
B=(u32)*(A);if(B>=0x80)sqlite3GetVarint32((A),(u32*)&(B))
#define putVarint32(A,B) \
(u8)(((u32)(B)<(u32)0x80)?(*(A)=(unsigned char)(B)),1:\
sqlite3PutVarint((A),(B)))