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:
14
src/vdbe.c
14
src/vdbe.c
@@ -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 ){
|
||||
|
Reference in New Issue
Block a user