Files
flatpak/tests
Simon McVittie 3498ecf9ab app, common, tests: 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.

One 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, I don't think it's actually relevant
whether we are doing a stable sort in any of these places: most of the
time we are sorting an array of unique items (often the keys of a hash
table, which are necessarily unique), therefore the compare function
will not compare equal in any case.

Another advantage of the GLib functions is that they are portable,
unlike qsort_r(). However, Flatpak is Linux-only, so we can freely use
useful functions like qsort_r().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-15 13:53:07 +01:00
..
2022-10-24 16:12:14 +01:00
2022-10-24 16:12:14 +01:00
2019-12-17 14:55:13 +01:00
2024-05-13 14:10:14 -05:00
2016-02-25 19:03:09 +01:00
2022-10-24 16:12:14 +01:00
2020-03-20 15:37:10 +01:00
2024-05-13 14:10:14 -05:00
2024-02-13 08:20:57 -06:00
2022-08-22 19:48:10 -07:00