mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-06 22:59:20 +02:00
Remove unused variable in statext_mcv_serialize()
The itemlen variable used to be referenced in multiple places, but since reworking the serialization code it's used only in one assert. Fixed by removing the variable and calling the macro from the assert directly. Backpatch to 12, where this code was introduced. Reported-by: Jeff Janes Discussion: https://postgr.es/m/CAMkU=1zc_ovH9NZd_9ovuiEWkF9yX06URUDdXCmgDydf-bqB5A@mail.gmail.com
This commit is contained in:
parent
e74d141d0d
commit
a5dc37866a
@ -911,10 +911,9 @@ statext_mcv_serialize(MCVList *mcvlist, VacAttrStats **stats)
|
|||||||
for (i = 0; i < mcvlist->nitems; i++)
|
for (i = 0; i < mcvlist->nitems; i++)
|
||||||
{
|
{
|
||||||
MCVItem *mcvitem = &mcvlist->items[i];
|
MCVItem *mcvitem = &mcvlist->items[i];
|
||||||
int itemlen = ITEM_SIZE(dim);
|
|
||||||
|
|
||||||
/* don't write beyond the allocated space */
|
/* don't write beyond the allocated space */
|
||||||
Assert(ptr <= (endptr - itemlen));
|
Assert(ptr <= (endptr - ITEM_SIZE(dim)));
|
||||||
|
|
||||||
/* copy NULL and frequency flags into the serialized MCV */
|
/* copy NULL and frequency flags into the serialized MCV */
|
||||||
memcpy(ptr, mcvitem->isnull, sizeof(bool) * ndims);
|
memcpy(ptr, mcvitem->isnull, sizeof(bool) * ndims);
|
||||||
|
Loading…
Reference in New Issue
Block a user