mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Add reusable routine for making arrays unique.
Introduce qunique() and qunique_arg(), which can be used after qsort() and qsort_arg() respectively to remove duplicate values. Use it where appropriate. Author: Thomas Munro Reviewed-by: Tom Lane (in an earlier version) Discussion: https://postgr.es/m/CAEepm%3D2vmFTNpAmwbGGD2WaryM6T3hSDVKQPfUwjdD_5XY6vAA%40mail.gmail.com
This commit is contained in:
@ -41,8 +41,9 @@ compareWordEntryPos(const void *a, const void *b)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes duplicate pos entries. If there's two entries with same pos
|
||||
* but different weight, the higher weight is retained.
|
||||
* Removes duplicate pos entries. If there's two entries with same pos but
|
||||
* different weight, the higher weight is retained, so we can't use
|
||||
* qunique here.
|
||||
*
|
||||
* Returns new length.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user