From 65421329990b2fa8615afb9746814880fb65ccd9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 19 Dec 2008 23:43:52 +0100 Subject: [PATCH] Simplify xbps_find_pkg_in_dict(). --HG-- extra : convert_revision : 345646a40ce381402647c21033d711e77d8ce7a9 --- utils/plist_utils.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/utils/plist_utils.c b/utils/plist_utils.c index d75c7830b83..fe4ed422e08 100644 --- a/utils/plist_utils.c +++ b/utils/plist_utils.c @@ -81,19 +81,14 @@ prop_dictionary_t xbps_find_pkg_in_dict(prop_dictionary_t dict, const char *key, const char *pkgname) { - prop_array_t array; prop_object_iterator_t iter; prop_object_t obj; const char *dpkgn; - if (dict == NULL || pkgname == NULL || key == NULL) + if (pkgname == NULL) return NULL; - array = prop_dictionary_get(dict, key); - if (array == NULL || prop_object_type(array) != PROP_TYPE_ARRAY) - return NULL; - - iter = prop_array_iterator(array); + iter = xbps_get_array_iter_from_dict(dict, key); if (iter == NULL) return NULL;