From: Brian Dolbec Date: Sat, 29 Jan 2011 10:11:18 +0000 (-0800) Subject: optimize isHardMasked() a little more X-Git-Tag: v2.2.0_alpha20~78 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6b7177c92af62ee17200f118dcdcad35e50c7ade;p=portage.git optimize isHardMasked() a little more --- diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index e7302b351..96c76b965 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -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