aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-08-22 13:22:32 +0000
committerdrh <drh@noemail.net>2014-08-22 13:22:32 +0000
commit3f5b199eb596a6e8031647d93e00451ade43806e (patch)
tree154bfd686adc46e2231c07191e93007564e2bec9 /src
parent5ab567078a924d9eeff3616433532dd2905a21c7 (diff)
downloadsqlite-3f5b199eb596a6e8031647d93e00451ade43806e.tar.gz
sqlite-3f5b199eb596a6e8031647d93e00451ade43806e.zip
Change a while-loop into a do-loop in sqlite3VdbeSerialPut() for a small
size reduction and performance improvement. FossilOrigin-Name: 750bb0a0960606ab24037e0992e9f7a17524cc3e
Diffstat (limited to 'src')
-rw-r--r--src/vdbeaux.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index fb3f7c3a8..83c6e1f65 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -2933,10 +2933,11 @@ u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){
v = pMem->u.i;
}
len = i = sqlite3VdbeSerialTypeLen(serial_type);
- while( i-- ){
- buf[i] = (u8)(v&0xFF);
+ assert( i>0 );
+ do{
+ buf[--i] = (u8)(v&0xFF);
v >>= 8;
- }
+ }while( i );
return len;
}