summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-10-26 13:26:43 +0200
committerThomas Haller <thaller@redhat.com>2023-11-15 17:58:04 +0100
commit7ab9a2b69f531f16d87771b65352eaa1fde827ae (patch)
tree2dcea1c4f7564662a71c59678c3ac4b378f44cb9
parent9f9a89d7781dbb4fba851cfcd997cf19601e4adc (diff)
glib-aux: add nm_strvarray_contains() helper
-rw-r--r--src/libnm-glib-aux/nm-shared-utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h
index 954280d5c0..5c7ea95714 100644
--- a/src/libnm-glib-aux/nm-shared-utils.h
+++ b/src/libnm-glib-aux/nm-shared-utils.h
@@ -3112,6 +3112,8 @@ nm_strvarray_find_first(GArray *strv, const char *needle)
return -1;
}
+#define nm_strvarray_contains(strv, needle) (nm_strvarray_find_first((strv), (needle)) >= 0)
+
static inline gboolean
nm_strvarray_remove_first(GArray *strv, const char *needle)
{