From d2f5535162ab4ec562e0ff1f07becf32dae90678 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 3 Dec 2010 06:36:05 +0100 Subject: [PATCH] lib/plist: no need to check against NULL if prop_object_type() is used. --- lib/plist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/plist.c b/lib/plist.c index 175b18ee..1e8037c2 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -119,7 +119,7 @@ xbps_callback_array_iter_reverse_in_dict(prop_dictionary_t dict, assert(fn != NULL); array = prop_dictionary_get(dict, key); - if (array == NULL || prop_object_type(array) != PROP_TYPE_ARRAY) { + if (prop_object_type(array) != PROP_TYPE_ARRAY) { xbps_dbg_printf("invalid key '%s' for dictionary", key); return EINVAL; } @@ -297,7 +297,7 @@ xbps_get_array_iter_from_dict(prop_dictionary_t dict, const char *key) assert(key != NULL); array = prop_dictionary_get(dict, key); - if (array == NULL || prop_object_type(array) != PROP_TYPE_ARRAY) { + if (prop_object_type(array) != PROP_TYPE_ARRAY) { errno = EINVAL; return NULL; } @@ -380,7 +380,7 @@ xbps_remove_pkg_from_dict(prop_dictionary_t dict, assert(pkgname != NULL); array = prop_dictionary_get(dict, key); - if (array == NULL || prop_object_type(array) != PROP_TYPE_ARRAY) { + if (prop_object_type(array) != PROP_TYPE_ARRAY) { errno = EINVAL; xbps_dbg_printf("invalid array type for key: %s pkgname: %s\n", key, pkgname);