postgresql/src
Tom Lane 569ed7f483 Redesign the API for list sorting (list_qsort becomes list_sort).
In the wake of commit 1cff1b95a, the obvious way to sort a List
is to apply qsort() directly to the array of ListCells.  list_qsort
was building an intermediate array of pointers-to-ListCells, which
we no longer need, but getting rid of it forces an API change:
the comparator functions need to do one less level of indirection.

Since we're having to touch the callers anyway, let's do two additional
changes: sort the given list in-place rather than making a copy (as
none of the existing callers have any use for the copying behavior),
and rename list_qsort to list_sort.  It was argued that the old name
exposes more about the implementation than it should, which I find
pretty questionable, but a better reason to rename it is to be sure
we get the attention of any external callers about the need to fix
their comparator functions.

While we're at it, change four existing callers of qsort() to use
list_sort instead; previously, they all had local reinventions
of list_qsort, ie build-an-array-from-a-List-and-qsort-it.
(There are some other places where changing to list_sort perhaps
would be worthwhile, but they're less obviously wins.)

Discussion: https://postgr.es/m/29361.1563220190@sss.pgh.pa.us
2019-07-16 11:51:44 -04:00
..
backend Redesign the API for list sorting (list_qsort becomes list_sort). 2019-07-16 11:51:44 -04:00
bin Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
common Use consistent style for checking return from system calls 2019-07-07 15:28:49 +02:00
fe_utils Use appendStringInfoString and appendPQExpBufferStr where possible 2019-07-04 13:01:13 +12:00
include Redesign the API for list sorting (list_qsort becomes list_sort). 2019-07-16 11:51:44 -04:00
interfaces Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
makefiles Remove support for non-ELF BSD systems 2019-07-01 23:56:20 +01:00
pl Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
port Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
timezone Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
tools Fix some inconsistencies in MSVC scripts 2019-07-13 16:51:31 +09:00
tutorial Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Remove support for non-ELF BSD systems 2019-07-01 23:56:20 +01:00
Makefile.shlib Remove support for non-ELF BSD systems 2019-07-01 23:56:20 +01:00
nls-global.mk Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00