Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdaba2b

Browse files
author
Alexander Korotkov
authored
Merge pull request #3 from Octonica/crossmatch_cnode
remove small allocation from crossmatch()
2 parents cd8da52 + ff0453f commit fdaba2b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crossmatch.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,14 +878,12 @@ crossmatch(CrossmatchContext *ctx, ItemPointer values)
878878
/* Return next result pair if any. Otherwise close SRF. */
879879
if (ctx->resultsPairs != NIL)
880880
{
881-
ResultPair *itemPointerPair = (ResultPair *) palloc(sizeof(ResultPair));
882-
883-
*itemPointerPair = *((ResultPair *) linitial(ctx->resultsPairs));
881+
ResultPair itemPointerPair = *((ResultPair *) linitial(ctx->resultsPairs));
884882
pfree(linitial(ctx->resultsPairs));
885883
ctx->resultsPairs = list_delete_first(ctx->resultsPairs);
886884

887-
values[0] = itemPointerPair->iptr1;
888-
values[1] = itemPointerPair->iptr2;
885+
values[0] = itemPointerPair.iptr1;
886+
values[1] = itemPointerPair.iptr2;
889887
}
890888
else
891889
{

0 commit comments

Comments
 (0)