mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 19:20:35 +01:00
shared: add nm_g_hash_table_*() utils for accepting %NULL hash argument
This commit is contained in:
parent
55a058aeef
commit
63545d31ca
1 changed files with 20 additions and 0 deletions
|
|
@ -1309,6 +1309,26 @@ char *nm_utils_g_slist_strlist_join (const GSList *a, const char *separator);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline guint
|
||||
nm_g_hash_table_size (GHashTable *hash)
|
||||
{
|
||||
return hash ? g_hash_table_size (hash) : 0u;
|
||||
}
|
||||
|
||||
static inline gpointer
|
||||
nm_g_hash_table_lookup (GHashTable *hash, gconstpointer key)
|
||||
{
|
||||
return hash ? g_hash_table_lookup (hash, key) : NULL;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
nm_g_hash_table_remove (GHashTable *hash, gconstpointer key)
|
||||
{
|
||||
return hash ? g_hash_table_remove (hash, key) : FALSE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gssize nm_utils_ptrarray_find_binary_search (gconstpointer *list,
|
||||
gsize len,
|
||||
gconstpointer needle,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue