Skip to content

Commit 2f0491d

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 3ea1ab2 commit 2f0491d

File tree

4 files changed

+319
-170
lines changed

4 files changed

+319
-170
lines changed

src/backend/access/gist/gist.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,18 +1238,12 @@ gistSplit(Relation r,
12381238
IndexTuple *lvectup,
12391239
*rvectup;
12401240
GistSplitVector v;
1241-
GistEntryVector *entryvec;
12421241
int i;
12431242
SplitedPageLayout *res = NULL;
12441243

1245-
/* generate the item array */
1246-
entryvec = palloc(GEVHDRSZ + (len + 1) * sizeof(GISTENTRY));
1247-
entryvec->n = len + 1;
1248-
12491244
memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
12501245
memset(v.spl_risnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
1251-
gistSplitByKey(r, page, itup, len, giststate,
1252-
&v, entryvec, 0);
1246+
gistSplitByKey(r, page, itup, len, giststate, &v, 0);
12531247

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

0 commit comments

Comments
 (0)