From 46bee5298b690712872a86a353c4045bf20d6392 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 6 May 2020 12:46:14 +0200 Subject: [PATCH] shared: add nm_g_ptr_array_len() helper --- shared/nm-glib-aux/nm-shared-utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h index d5990c2d54..cfaaf573cb 100644 --- a/shared/nm-glib-aux/nm-shared-utils.h +++ b/shared/nm-glib-aux/nm-shared-utils.h @@ -1435,6 +1435,14 @@ char *nm_utils_g_slist_strlist_join (const GSList *a, const char *separator); /*****************************************************************************/ +static inline guint +nm_g_ptr_array_len (const GPtrArray *arr) +{ + return arr ? arr->len : 0u; +} + +/*****************************************************************************/ + static inline guint nm_g_hash_table_size (GHashTable *hash) {