Use a list comprehension to simplify the code for bug #55871.
authorZac Medico <zmedico@gentoo.org>
Mon, 10 Jul 2006 08:04:43 +0000 (08:04 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 10 Jul 2006 08:04:43 +0000 (08:04 -0000)
svn path=/main/trunk/; revision=3831

bin/emerge

index 26b173cae63ac6344f8f43f535c773783986f318..78872bd221f7937b994728f5c52590b7181d2bdc 100755 (executable)
@@ -1024,10 +1024,9 @@ class depgraph:
                                        myeb_pkg_matches = bindb.match(x)
                                        if "--usepkgonly" not in self.myopts:
                                                # Remove any binary package entries that are masked in the portage tree (#55871)
-                                               for idx in xrange(len(myeb_pkg_matches)-1, -1, -1):
-                                                       if myeb_pkg_matches[idx] not in myeb_matches and \
-                                                               portdb.cpv_exists(myeb_pkg_matches[idx]):
-                                                               del myeb_pkg_matches[idx]
+                                               myeb_pkg_matches = [pkg for pkg in myeb_pkg_matches \
+                                                       if pkg not in myeb_matches and \
+                                                       portdb.cpv_exists(pkg)]
                                        myeb_pkg = portage.best(myeb_pkg_matches)
 
                                if not myeb_pkg: