diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-09 12:05:38 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-09 12:15:32 +0000 |
commit | 17876994c473ee244df17dec42c1a79e08407e2c (patch) | |
tree | c5646428eb1b0520b32e429f90c60c4f4b4925cf /src/mm-utils.c | |
parent | dc66ee2aaadefd56f17681e95454748a958d96f3 (diff) |
utils: remove custom g_ptr_array_find_with_equal_func()
This was required when building with GLib < 2.54, but we now require
2.56 as minimum, so it is no longer needed.
Diffstat (limited to 'src/mm-utils.c')
-rw-r--r-- | src/mm-utils.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/mm-utils.c b/src/mm-utils.c deleted file mode 100644 index 95fbb552..00000000 --- a/src/mm-utils.c +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Singleton support imported from NetworkManager. - * (C) Copyright 2014 Red Hat, Inc. - * - * GPtrArray lookup with GEqualFunc imported from GLib 2.48 - */ - -#include "mm-utils.h" - -#if !GLIB_CHECK_VERSION(2,54,0) - -gboolean -mm_ptr_array_find_with_equal_func (GPtrArray *haystack, - gconstpointer needle, - GEqualFunc equal_func, - guint *index_) -{ - guint i; - - g_return_val_if_fail (haystack != NULL, FALSE); - - if (equal_func == NULL) - equal_func = g_direct_equal; - - for (i = 0; i < haystack->len; i++) { - if (equal_func (g_ptr_array_index (haystack, i), needle)) { - if (index_ != NULL) - *index_ = i; - return TRUE; - } - } - - return FALSE; -} - -#endif |