From 511dbffa9e054894cb2f9b1bc882d16fb5e01519 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 21 Feb 2011 23:21:53 +0100 Subject: [PATCH] Simplify find_pkg_in_array(). --- lib/plist_find.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/plist_find.c b/lib/plist_find.c index 745621ce..5d7f2819 100644 --- a/lib/plist_find.c +++ b/lib/plist_find.c @@ -130,21 +130,19 @@ find_pkg_in_array(prop_array_t array, const char *str, bool bypattern) continue; if (xbps_pkgpattern_match(pkgver, __UNCONST(str))) break; - /* - * Finally check if package pattern matches - * any virtual package version in dictionary. - */ - if (xbps_find_virtual_pkg_in_dict(obj, str, true)) - break; } else { if (!prop_dictionary_get_cstring_nocopy(obj, "pkgname", &dpkgn)) continue; if (strcmp(dpkgn, str) == 0) break; - if (xbps_find_virtual_pkg_in_dict(obj, str, false)) - break; } + /* + * Finally check if package pattern matches + * any virtual package version in dictionary. + */ + if (xbps_find_virtual_pkg_in_dict(obj, str, bypattern)) + break; } prop_object_iterator_release(iter); if (obj == NULL) {