Skip to content

cf_map_sort

Category: map
GitHub: cute_map.h


Sorts the {key, item} pairs by values using a comparator.

#define cf_map_sort(m, cmp) map_sort(m, cmp)
Parameters Description
m The map. Can be NULL. Must be declared with CF_MAP(T).
cmp Comparator function: int cmp(const void* a, const void* b). Receives pointers to items.

Remarks

The keys and items returned by map_keys and map_items will be sorted. This is not a stable sort.

CF_MAP
cf_map_ssort
cf_map_swap
cf_map_keys
cf_map_items
cf_map_size