]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Replace insertion sort in contrib/intarray with qsort().
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Mar 2015 03:22:03 +0000 (23:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Mar 2015 03:22:03 +0000 (23:22 -0400)
commit9288645b596efde3a58e267896b38f8f089a2920
treebbbdad18a768f1a9452f668777351e723047da69
parent043fe5c5a62a71455162b322c5ac819716702b02
Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.
contrib/intarray/_int_tool.c