summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-05-06 13:22:53 +0200
committerThomas Haller <thaller@redhat.com>2020-05-06 15:19:24 +0200
commit070535c6f6473af17cb1ae62a23b9ead217cbe15 (patch)
tree796ae2fcaa765a3bf634b0fe20b6d2ec96761e3e /shared
parent46bee5298b690712872a86a353c4045bf20d6392 (diff)
downloadNetworkManager-070535c6f6473af17cb1ae62a23b9ead217cbe15.tar.gz
shared: add nm_g_array_len() helper
Diffstat (limited to 'shared')
-rw-r--r--shared/nm-glib-aux/nm-shared-utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h
index cfaaf573cb..10d259cced 100644
--- a/shared/nm-glib-aux/nm-shared-utils.h
+++ b/shared/nm-glib-aux/nm-shared-utils.h
@@ -1436,6 +1436,14 @@ char *nm_utils_g_slist_strlist_join (const GSList *a, const char *separator);
/*****************************************************************************/
static inline guint
+nm_g_array_len (const GArray *arr)
+{
+ return arr ? arr->len : 0u;
+}
+
+/*****************************************************************************/
+
+static inline guint
nm_g_ptr_array_len (const GPtrArray *arr)
{
return arr ? arr->len : 0u;