Replace insertion sort in contrib/intarray with qsort().
authorTom Lane
Mon, 16 Mar 2015 03:22:03 +0000 (23:22 -0400)
committerTom Lane
Mon, 16 Mar 2015 03:22:03 +0000 (23:22 -0400)
commit83587a075dd1d6380de24f16df85bf629689effc
treee1cf07f192ed5c7014575b971b61172588d8b9e2
parent2cb76fa6ff63d1d94a18012ec95835af5355f0e5
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