-static int
-scm_default_compare (void const *a, void const *b)
-{
- SCM pa = *(SCM *) a;
- SCM pb = *(SCM *) b;
- if (pa == pb)
- return 0;
- return pa < pb ? -1 : 1;
-}
-
-/* Modify LST in place: qsort it.
-
-FIXME: unused, junk? */
-SCM
-ly_list_qsort_uniq_x (SCM lst)
-{
- int len = scm_ilength (lst);
- SCM *arr = new SCM[len];
- int k = 0;
- for (SCM s = lst; SCM_NNULLP (s); s = scm_cdr (s))
- arr[k++] = scm_car (s);
-
- assert (k == len);
- qsort (arr, len, sizeof (SCM), &scm_default_compare);
-
- SCM *tail = &lst;
- for (int i = 0; i < len; i++)
- if (!i || arr[i] != arr[i - 1])
- {
- SCM_SETCAR (*tail, arr[i]);
- tail = SCM_CDRLOC (*tail);
- }
-
- *tail = SCM_EOL;
- delete[] arr;
-
- return lst;
-}
-