1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

In the OP_MakeRecord opcode, factor out affinity changes into separate loop,

for a slight performance advantage.

FossilOrigin-Name: 1c6ee9b85f61e5cdb5d9b7815cddf526dc78aaa7
This commit is contained in:
drh
2013-12-10 20:53:01 +00:00
parent b0e7704e9f
commit 3e6c060fac
3 changed files with 17 additions and 11 deletions

View File

@@ -2595,16 +2595,22 @@ case OP_MakeRecord: {
pOut = &aMem[pOp->p3];
memAboutToChange(p, pOut);
/* Apply the requested affinity to all inputs
*/
assert( pData0<=pLast );
if( zAffinity ){
pRec = pData0;
do{
applyAffinity(pRec, *(zAffinity++), encoding);
}while( (++pRec)<=pLast );
}
/* Loop through the elements that will make up the record to figure
** out how much space is required for the new record.
*/
assert( pData0<=pLast );
pRec = pLast;
do{
assert( memIsValid(pRec) );
if( zAffinity ){
applyAffinity(pRec, zAffinity[pRec-pData0], encoding);
}
serial_type = sqlite3VdbeSerialType(pRec, file_format);
len = sqlite3VdbeSerialTypeLen(serial_type);
if( pRec->flags & MEM_Zero ){