Skip to content

Commit a260208

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 ccb5def commit a260208

File tree

4 files changed

+320
-172
lines changed

4 files changed

+320
-172
lines changed

src/backend/access/gist/gist.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -945,18 +945,12 @@ gistSplit(Relation r,
945945
IndexTuple *lvectup,
946946
*rvectup;
947947
GistSplitVector v;
948-
GistEntryVector *entryvec;
949948
int i;
950949
SplitedPageLayout *res = NULL;
951950

952-
/* generate the item array */
953-
entryvec = palloc(GEVHDRSZ + (len + 1) * sizeof(GISTENTRY));
954-
entryvec->n = len + 1;
955-
956951
memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
957952
memset(v.spl_risnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
958-
gistSplitByKey(r, page, itup, len, giststate,
959-
&v, entryvec, 0);
953+
gistSplitByKey(r, page, itup, len, giststate, &v, 0);
960954

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

0 commit comments

Comments
 (0)