summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-21 15:29:25 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-21 15:29:25 +0000
commit0202f59d1ba4309d25022ecdb7faa6114f9269cd (patch)
tree518b15be3988ef701b3763ea5f5ce51841eb0b98
parent6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5 (diff)
downloadportage-0202f59d1ba4309d25022ecdb7faa6114f9269cd.tar.gz
portage-0202f59d1ba4309d25022ecdb7faa6114f9269cd.tar.bz2
portage-0202f59d1ba4309d25022ecdb7faa6114f9269cd.zip
Simplify match_to_list(). Thanks to Marat Radchenko <marat@slonopotamus.org>
for this patch from bug #276813. svn path=/main/trunk/; revision=14325
-rw-r--r--pym/portage/dep.py9
1 files changed, 1 insertions, 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):
"""