mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-17 07:00:03 -05:00
dict: add function to sort
This commit is contained in:
parent
1f700e7cdd
commit
36904e1612
1 changed files with 7 additions and 0 deletions
|
|
@ -62,6 +62,13 @@ static inline int spa_dict_item_compare(const void *i1, const void *i2)
|
|||
return strcmp(it1->key, it2->key);
|
||||
}
|
||||
|
||||
static inline void spa_dict_qsort(struct spa_dict *dict)
|
||||
{
|
||||
qsort((void*)dict->items, dict->n_items, sizeof(struct spa_dict_item),
|
||||
spa_dict_item_compare);
|
||||
SPA_FLAG_SET(dict->flags, SPA_DICT_FLAG_SORTED);
|
||||
}
|
||||
|
||||
static inline const struct spa_dict_item *spa_dict_lookup_item(const struct spa_dict *dict,
|
||||
const char *key)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue