Skip to content

Commit a069840

Browse files
committed
Document and clean up gistsplit.c.
Improve comments, rename some variables and functions, slightly simplify a couple of APIs, in an attempt to make this code readable by people other than its original author. Even though this is essentially just cosmetic, back-patch to all active branches, because otherwise it's going to make back-patching future fixes in this file very painful.
1 parent 4d4c008 commit a069840

File tree

4 files changed

+319
-171
lines changed

4 files changed

+319
-171
lines changed

src/backend/access/gist/gist.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,18 +1378,12 @@ gistSplit(Relation r,
13781378
IndexTuple *lvectup,
13791379
*rvectup;
13801380
GistSplitVector v;
1381-
GistEntryVector *entryvec;
13821381
int i;
13831382
SplitedPageLayout *res = NULL;
13841383

1385-
/* generate the item array */
1386-
entryvec = palloc(GEVHDRSZ + (len + 1) * sizeof(GISTENTRY));
1387-
entryvec->n = len + 1;
1388-
13891384
memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
13901385
memset(v.spl_risnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
1391-
gistSplitByKey(r, page, itup, len, giststate,
1392-
&v, entryvec, 0);
1386+
gistSplitByKey(r, page, itup, len, giststate, &v, 0);
13931387

13941388
/* form left and right vector */
13951389
lvectup = (IndexTuple *) palloc(sizeof(IndexTuple) * (len + 1));

0 commit comments

Comments
 (0)