Skip to content
Snippets Groups Projects
Commit 45ed2aad authored by Simon McVittie's avatar Simon McVittie
Browse files

Avoid deprecated g_qsort_with_data()


For historical reasons g_qsort_with_data() "only" works with up to 2**31
items, so it won't necessarily work for pathologically large arrays
and therefore is deprecated.

The advantage of g_qsort_with_data() and its replacement g_sort_array()
is that GLib guarantees that they are a stable sort (will not permute
items that already compare equal), which is not a guarantee for glibc's
qsort() and qsort_r(). However, in each of these places we are sorting
the keys from a hash table, which are unique anyway, so there is no
advantage to a stable sort.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent fae8cd38
No related branches found
No related tags found
1 merge request!750Fix build with GLib 2.81.x and glibc 2.39
Pipeline #98654 failed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment