diff options
author | Thomas Haller <thaller@redhat.com> | 2018-09-01 18:07:57 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-09-04 07:38:30 +0200 |
commit | 67805f0d1e32214749c87a7f4f6a65d9faa590d7 (patch) | |
tree | f016483cf1255420c23dd02f0dd1bb0efc282bd2 /shared | |
parent | f61545629e0f1762c76452a5c9dffffc08c18b80 (diff) |
shared: add nm_gbytes_equal0() helper
Like g_bytes_equal(), except that it accepts %NULL arguments.
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-utils/nm-shared-utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-shared-utils.h b/shared/nm-utils/nm-shared-utils.h index b081db912..171544fea 100644 --- a/shared/nm-utils/nm-shared-utils.h +++ b/shared/nm-utils/nm-shared-utils.h @@ -221,6 +221,12 @@ nm_utils_is_separator (const char c) /*****************************************************************************/ +static inline gboolean +nm_gbytes_equal0 (GBytes *a, GBytes *b) +{ + return a == b || (a && b && g_bytes_equal (a, b)); +} + gboolean nm_utils_gbytes_equal_mem (GBytes *bytes, gconstpointer mem_data, gsize mem_len); |