Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87a2880

Browse files
committed
Change call of (static) tuplesort_gettuple_common to public tuplesort_getindextuple
1 parent8094912 commit87a2880

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

‎src/rumsort.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,30 +386,22 @@ rum_tuplesort_performsort(RumTuplesortstate * state)
386386
}
387387

388388
/*
389-
* Internal routine to fetch the next tuple in either forward or back
390-
*direction into *stup.Returnsfalse if no more tuples.
389+
* Internal routine to fetch the nextindextuple in either forward or back direction.
390+
* ReturnsNULL if no more tuples. Returned tuple belongs to tuplesort memory context. Caller may not rely on tuple remaining valid after any further manipulation of tuplesort.
391391
* If *should_free is set, the caller must pfree stup.tuple when done with it.
392392
*
393-
* NOTE: in PG 10 and newertuplesort_gettuple_common allocatestuple in tuplesort
394-
*context and itshould not be freed by caller.
393+
* NOTE: in PG 10 and newertuple is always allocatedtuple in tuplesort context and
394+
* should not be freed by caller.
395395
*/
396396
staticvoid*
397397
rum_tuplesort_getrum_internal(RumTuplesortstate*state,boolforward,bool*should_free)
398398
{
399-
MemoryContextoldcontext=MemoryContextSwitchTo(state->sortcontext);
400-
SortTuplestup;
401-
boolres;
402-
403399
#ifPG_VERSION_NUM >=100000
404-
res=tuplesort_gettuple_common(state,forward,&stup);
405400
*should_free= false;
401+
return (RumSortItem*)tuplesort_getindextuple(state,forward);
406402
#else
407-
res=tuplesort_gettuple_common(state,forward,&stup,should_free);
403+
return (RumSortItem*)tuplesort_getindextuple(state,forward,should_free);
408404
#endif
409-
410-
MemoryContextSwitchTo(oldcontext);
411-
412-
returnres ?stup.tuple :NULL;
413405
}
414406

415407
RumSortItem*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp