Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ef777cb

Browse files
committed
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
1 parent 02e95a5 commit ef777cb

File tree

1 file changed

+1
-2
lines changed
  • src/backend/statistics

1 file changed

+1
-2
lines changed

src/backend/statistics/mcv.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,9 @@ statext_mcv_serialize(MCVList *mcvlist, VacAttrStats **stats)
911911
for (i = 0; i < mcvlist->nitems; i++)
912912
{
913913
MCVItem *mcvitem = &mcvlist->items[i];
914-
int itemlen = ITEM_SIZE(dim);
915914

916915
/* don't write beyond the allocated space */
917-
Assert(ptr <= (endptr - itemlen));
916+
Assert(ptr <= (endptr - ITEM_SIZE(dim)));
918917

919918
/* copy NULL and frequency flags into the serialized MCV */
920919
memcpy(ptr, mcvitem->isnull, sizeof(bool) * ndims);

0 commit comments

Comments
 (0)