From 0202f59d1ba4309d25022ecdb7faa6114f9269cd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 21 Sep 2009 15:29:25 +0000 Subject: Simplify match_to_list(). Thanks to Marat Radchenko for this patch from bug #276813. svn path=/main/trunk/; revision=14325 --- pym/portage/dep.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pym/portage/dep.py b/pym/portage/dep.py index b89278bdd..9d055912d 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -956,14 +956,7 @@ def match_to_list(mypkg, mylist): @rtype: List @return: A unique list of package atoms that match the given package atom """ - matches = [] - for x in mylist: - if not isinstance(x, Atom): - x = Atom(x) - if match_from_list(x, [mypkg]): - if x not in matches: - matches.append(x) - return matches + return [ x for x in set(mylist) if match_from_list(x, [mypkg]) ] def best_match_to_list(mypkg, mylist): """ -- cgit v1.2.3-1-g7c22