optimize isHardMasked() a little more
authorBrian Dolbec <brian.dolbec@gmail.com>
Sat, 29 Jan 2011 10:11:18 +0000 (02:11 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Jan 2011 09:11:58 +0000 (01:11 -0800)
pym/_emerge/Package.py

index e7302b3516ade51e6d0ec87305bf01980c747789..96c76b965916af56534fe8313b463ecaab75769f 100644 (file)
@@ -263,17 +263,14 @@ class Package(Task):
                        pmask = []
                if pmask:
                        # narrow pmask atoms down to the relevant repo
-                       n=[x for x in pmask if x.split('::')[-1] in [self.repo]]
+                       n = [x for x in pmask if x.split('::')[-1] in [self.repo]]
                        # hopefully it is down to only 1 mask atom
                        #print "n =", n
                        #count = 0
                        hardmasked = set()
                        for x in n:
                                #expand the atom to matching available ebuilds
-                               m = self.root_config.trees['porttree'].dbapi.xmatch("match-all",x)
-                               #print "m =", m
-                               for n in m:
-                                       hardmasked.update([n])
+                               hardmasked.update(self.root_config.trees['porttree'].dbapi.xmatch("match-all",x))
                                #count += 1
                        #print "for x in n: loop count =", count, hardmasked
                        return self.cpv in hardmasked