Change a while-loop into a do-loop in sqlite3VdbeSerialPut() for a small

size reduction and performance improvement.

FossilOrigin-Name: 750bb0a0960606ab24037e0992e9f7a17524cc3e
This commit is contained in:
drh
2014-08-22 13:22:32 +00:00
parent 5ab567078a
commit 3f5b199eb5
3 changed files with 11 additions and 10 deletions
+4 -3
View File
@@ -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;
}