diff options
Diffstat (limited to 'src/backend/nodes/list.c')
-rw-r--r-- | src/backend/nodes/list.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c index dbf6b30233a..94fb236dafe 100644 --- a/src/backend/nodes/list.c +++ b/src/backend/nodes/list.c @@ -1507,6 +1507,22 @@ list_sort(List *list, list_sort_comparator cmp) } /* + * list_sort comparator for sorting a list into ascending int order. + */ +int +list_int_cmp(const ListCell *p1, const ListCell *p2) +{ + int v1 = lfirst_int(p1); + int v2 = lfirst_int(p2); + + if (v1 < v2) + return -1; + if (v1 > v2) + return 1; + return 0; +} + +/* * list_sort comparator for sorting a list into ascending OID order. */ int |