Avoid unnecessary memory zeroing during expression list allocation.
FossilOrigin-Name: de28e6514a42438411e2c9d833ba660108128ca86d0b90f32925fb73195f4862
diff --git a/src/expr.c b/src/expr.c
index 707dfe4..27cebdb 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1488,7 +1488,9 @@
pList->nAlloc *= 2;
}
pItem = &pList->a[pList->nExpr++];
- memset(pItem, 0, sizeof(*pItem));
+ assert( offsetof(struct ExprList_item,zName)==sizeof(pItem->pExpr) );
+ assert( offsetof(struct ExprList_item,pExpr)==0 );
+ memset(&pItem->zName,0,sizeof(*pItem)-offsetof(struct ExprList_item,zName));
pItem->pExpr = pExpr;
return pList;
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 8ab0dda..8c52e02 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2831,10 +2831,10 @@
*/
struct SelectDest {
u8 eDest; /* How to dispose of the results. On of SRT_* above. */
- char *zAffSdst; /* Affinity used when eDest==SRT_Set */
int iSDParm; /* A parameter used by the eDest disposal method */
int iSdst; /* Base register where results are written */
int nSdst; /* Number of registers allocated */
+ char *zAffSdst; /* Affinity used when eDest==SRT_Set */
ExprList *pOrderBy; /* Key columns for SRT_Queue and SRT_DistQueue */
};