mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Change ginMergeItemPointers to return a palloc'd array.
That seems nicer than making it the caller's responsibility to pass a suitable-sized array. All the callers were just palloc'ing an array anyway.
This commit is contained in:
@@ -1303,10 +1303,9 @@ addItemsToLeaf(disassembledLeaf *leaf, ItemPointer newItems, int nNewItems)
|
||||
if (!cur->items)
|
||||
cur->items = ginPostingListDecode(cur->seg, &cur->nitems);
|
||||
|
||||
tmpitems = palloc((cur->nitems + nthis) * sizeof(ItemPointerData));
|
||||
ntmpitems = ginMergeItemPointers(tmpitems,
|
||||
cur->items, cur->nitems,
|
||||
nextnew, nthis);
|
||||
tmpitems = ginMergeItemPointers(cur->items, cur->nitems,
|
||||
nextnew, nthis,
|
||||
&ntmpitems);
|
||||
if (ntmpitems != cur->nitems)
|
||||
{
|
||||
cur->items = tmpitems;
|
||||
|
||||
Reference in New Issue
Block a user