Re: [HACKERS] Consolidate 'unique array values' logic into a reusable function?

2016-08-07 Thread Tom Lane
Thomas Munro writes: > Here's a sketch patch that creates a function array_unique which takes > the same arguments as qsort or qsort_arg and returns the new length. Hmm ... I'd be against using this in backend/regex/, because I still have hopes of converting that

[HACKERS] Consolidate 'unique array values' logic into a reusable function?

2016-08-06 Thread Thomas Munro
Hi, Looking at commits f10eab73d and c50d192c, I wondered why we don't have a reusable in-place unique function. It may be trivial, but we seem to have a lot of copies and variations in the tree. Here's a sketch patch that creates a function array_unique which takes the same arguments as qsort